Google search engine
Home Blog Page 68

Awesome Dialog In Flutter

0

Flutter is a portable UI toolkit. In other words, it’s a comprehensive app Software Development toolkit (SDK) that comes complete with widgets and tools. Flutter is a free and open-source tool to develop mobile, desktop, web applications. Flutter is a cross-platform development tool. This means that with the same code, we can create both ios and android apps. This is the best way to save time and resources in our entire process. In this, hot reload is gaining traction among mobile developers. Allows us to quickly see the changes implemented in the code with hot reload.

Hello friends, I will talk about my new blog on Awesome Dialog in flutter using the awesome_dialog_package. We will also implement a demo of Awesome Dialog, and describes its attributes, and how to use them in your flutter applications. So let’s get started.

awesome_dialog | Flutter Package
A new Flutter package project for simple and awesome dialogs To use this package, add awesome_dialog as a dependency in…pub.dev


Table of Contents :

Awesome Dialog

Attributes

Implementation

Code Implementation

Code File

Conclusion


Awesome Dialog :

The Animation Awesome Dialog is a type of flutter package that we use in the app to show some warning or confirmation about something to the user, in this we can use a different kind of animation in it by using some properties. And can set the color, of the text, etc.

Demo Module :

Attributes :

The following are the basic Attributes of the Awesome Dialog.

  • animType— Use the animType property to change the animation of the dialog.
  • dialogType— The dialogType be used the dialog type property like info, error etc.
  • title — The title property is used to set the dialog title to the dialog.
  • desc — The desc property is used for dialog descriptions.
  • autoHide — The autoHide property is hidden after some time, its time can be set to anything.

Implementation :

You need to implement it in your code respectively :

Step 1: Add dependencies.

Add dependencies to pubspec — yaml file.

dependencies:   
awesome_dialog: ^1.3.2

Step 2: import the package :

import 'package:awesome_dialog/awesome_dialog.dart';

Step 3: Run flutter package get

How to implement code in dart file :

Create a new dart file called awesome_dialog_demo.dart inside the lib folder.

First of all, we have created a home page screen in which five buttons have been created and at the click of each button, a new page will open in which we have shown the swiper list in different ways. Let us understand this in detail.

AnimatedButton(
text: 'Info Dialog',
pressEvent: () {},
),

Before using AwesomeDialog, we have used a container widget that has a column widget in child properties with AwasomeDialog inside which dialog type is Info. But at the click of each button, the dialog type is different.

AwesomeDialog(
context: context,
dialogType: DialogType.INFO,
borderSide: BorderSide(color: Colors.green, width: 2),
buttonsBorderRadius: BorderRadius.all(Radius.circular(2)),
headerAnimationLoop: false,
animType: AnimType.BOTTOMSLIDE,
title: 'INFO',
desc: 'Dialog description here...',
showCloseIcon: true,
btnCancelOnPress: () {},
btnOkOnPress: () {},
)..show();

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File:

import 'package:flutter/material.dart';
import 'package:awesome_dialog/awesome_dialog.dart';
class AwesomeDialogDemo extends StatefulWidget {
@override
_AwesomeDialogDemoState createState() => _AwesomeDialogDemoState();
}

class _AwesomeDialogDemoState extends State<AwesomeDialogDemo> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Awesome Dialog Demo'),
),
body: Center(
child: Container(
padding: EdgeInsets.all(16),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
AnimatedButton(
text: 'Info Dialog',
pressEvent: () {
AwesomeDialog(
context: context,
dialogType: DialogType.INFO,
borderSide: BorderSide(color: Colors.green, width: 2),
buttonsBorderRadius: BorderRadius.all(Radius.circular(2)),
headerAnimationLoop: false,
animType: AnimType.BOTTOMSLIDE,
title: 'INFO',
desc: 'Dialog description here...',
showCloseIcon: true,
btnCancelOnPress: () {},
btnOkOnPress: () {},
)..show();
},
),

SizedBox(
height: 16,
),
AnimatedButton(
text: 'Warning Dialog',
color: Colors.orange,
pressEvent: () {
AwesomeDialog(
context: context,
dialogType: DialogType.WARNING,
headerAnimationLoop: false,
animType: AnimType.TOPSLIDE,
showCloseIcon: true,
closeIcon: Icon(Icons.close_fullscreen_outlined),
title: 'Warning',
desc:
'Dialog description here',
btnCancelOnPress: () {},
btnOkOnPress: () {})
..show();
},
),
SizedBox(
height: 16,
),
AnimatedButton(
text: 'Error Dialog',
color: Colors.red,
pressEvent: () {
AwesomeDialog(
context: context,
dialogType: DialogType.ERROR,
animType: AnimType.RIGHSLIDE,
headerAnimationLoop: false,
title: 'Error',
desc:
'Dialog description here',
btnOkOnPress: () {},
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red)
..show();
},
),
SizedBox(
height: 16,
),
AnimatedButton(
text: 'Succes Dialog',
color: Colors.green,
pressEvent: () {
AwesomeDialog(
context: context,
animType: AnimType.LEFTSLIDE,
headerAnimationLoop: false,
dialogType: DialogType.SUCCES,
title: 'Succes',
desc:
'Dialog description here',
btnOkOnPress: () {
debugPrint('OnClcik');
},
btnOkIcon: Icons.check_circle,
onDissmissCallback: () {
debugPrint('Dialog Dissmiss from callback');
})
..show();
},
),
SizedBox(
height: 16,
),
AnimatedButton(
text: 'No Header Dialog',
color: Colors.cyan,
pressEvent: () {
AwesomeDialog(
context: context,
headerAnimationLoop: false,
dialogType: DialogType.NO_HEADER,
title: 'No Header',
desc:
'Dialog description here',
btnOkOnPress: () {
debugPrint('OnClcik');
},
btnOkIcon: Icons.check_circle,
)..show();
},
),
SizedBox(
height: 16,
),
AnimatedButton(
text: 'Custom Body Dialog',
color: Colors.blueGrey,
pressEvent: () {
AwesomeDialog(
context: context,
animType: AnimType.SCALE,
dialogType: DialogType.INFO,
body: Center(
child: Text(
'If the body is specified, then title and description will be ignored, this allows to further customize the dialogue.',
style: TextStyle(fontStyle: FontStyle.italic),
),
),
title: 'This is Ignored',
desc: 'This is also Ignored',
)..show();
},
),
SizedBox(
height: 16,
),
AnimatedButton(
text: 'Auto Hide Dialog',
color: Colors.purple,
pressEvent: () {
AwesomeDialog(
context: context,
dialogType: DialogType.INFO,
animType: AnimType.SCALE,
title: 'Auto Hide Dialog',
desc: 'AutoHide after 2 seconds',
autoHide: Duration(seconds: 2),
)..show();
},
),

SizedBox(
height: 16,
),
AnimatedButton(
text: 'Body with Input',
color: Colors.blueGrey,
pressEvent: () {
AwesomeDialog dialog;
dialog = AwesomeDialog(
context: context,
animType: AnimType.SCALE,
dialogType: DialogType.INFO,
keyboardAware: true,
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
Text(
'Form Data',
style: Theme.of(context).textTheme.headline6,
),
SizedBox(
height: 10,
),
Material(
elevation: 0,
color: Colors.blueGrey.withAlpha(40),
child: TextFormField(
autofocus: true,
minLines: 1,
decoration: InputDecoration(
border: InputBorder.none,
labelText: 'Title',
prefixIcon: Icon(Icons.text_fields),
),
),
),
SizedBox(
height: 10,
),
Material(
elevation: 0,
color: Colors.blueGrey.withAlpha(40),
child: TextFormField(
autofocus: true,
keyboardType: TextInputType.multiline,
maxLengthEnforced: true,
minLines: 2,
maxLines: null,
decoration: InputDecoration(
border: InputBorder.none,
labelText: 'Description',
prefixIcon: Icon(Icons.text_fields),
),
),
),
SizedBox(
height: 10,
),
AnimatedButton(
text: 'Close',
pressEvent: () {
dialog.dissmiss();
})
],
),
),
)..show();
},
),
],
),
),
)
)
);
}
}

Conclusion:

In this flutter article, I have explained an Awesome Dialog in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Awesome Dialog demo from our side.

I hope this blog will provide you with sufficient information in Trying up the Awesome Dialog in your flutter project. We will show you the Awesome Dialog is?, and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Dialog Using GetX in Flutter

Related: Cupertino Alert Dialog In Flutter

Related: Rating Dialog In Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.


Linear Gauge Widget In Flutter

0

The flutter widget is built using a modern framework. It is like a reaction. In this, we start with the widget to create any application. Each component in the screen is a widget. The widget describes what his outlook should be given his present configuration and condition. Widget shows were similar to its idea and current setup and state. Flutter is a free and open-source tool to develop mobile, desktop, web applications with a single code base.

In this article, we will explore the Linear Gauge in flutter using the linear_gauge_package. With the help of the package, we can easily achieve a flutter linear gauge. So let’s get started.

syncfusion_flutter_gauges | Flutter Package
The Flutter Gauges library includes the data visualization widgets Linear Gauge and Radial Gauge (a.k.a. circular…pub. dev


Table Of Contents :

Linear Gauge Widget

Implementation

Code Implement

Code File

Conclusion


Linear Gauge Widget :

The Flutter Linear Gauge is a data visualization widget that is used to display data on a linear scale. We can show the data vertically or vertically. In this, we have a rich of features in the form of axes, range, pointers, and animations. With this gauge, it is very easy to simulate a thermometer, progress bar, water tracker, etc.

Implementation :

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies :

dependencies:   
syncfusion_flutter_gauges: ^19.1.56

Step 2: Importing

import 'package:syncfusion_flutter_gauges/gauges.dart';

Step 3: Run flutter package get

Code Implementation :

Create a new dart file called linear_gauge_home_page.dart inside the lib folder.

First of all, we have created a home page screen in which five buttons have been created and at the click of each button, a new page will open in which we have shown the linear gauge in different ways. Let us understand this in detail.

Axis track:

The flutter linear gauge axis is a scale where a group of values ​​is plotted. We have used the gauge axis in this screen in which we have used the inside of the axisTrackStyle property inside the SfLinearGauge. Has taken the color of the linear-gradient type and has given its thickness value of 10. Let us understand this through a reference.

SfLinearGauge(
isAxisInversed:true,
axisTrackStyle: LinearAxisTrackStyle(
thickness: 10,
gradient: LinearGradient(
colors: [Colors.red, Colors.orange],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: [0.4, 0.9],
tileMode: TileMode.clamp
)
),
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Ticks and label:

The flutter linear gauge can easily customize the label and ticks of the axis elements. As we have done in this screen, we have first taken a column in this screen, which describes the label and tick gauge, first of all in the tick gauge. The position of the ticks is displayed, the color of the ticks, etc., and the position label color size of the label is displayed in the label gauge. Let us understand this through a reference.

SfLinearGauge(

tickPosition: LinearElementPosition.outside,
labelPosition: LinearLabelPosition.outside,
majorTickStyle: LinearTickStyle(length: 10, thickness: 2.5, color: Colors.orange),
minorTickStyle: LinearTickStyle(length: 5, thickness: 1.75, color: Colors.red)),

SfLinearGauge(
tickPosition: LinearElementPosition.inside,
labelPosition: LinearLabelPosition.inside,
axisLabelStyle: TextStyle(
color: Colors.red,
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: FontWeight.bold,
fontFamily: 'Times'),
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Ranges:

The flutter linear gauge range is a visual element that tells us the value axis tracking. For a linear gauge, we can add multiple ranges with different styles. As we have used the range in this screen in which three different ranges have been taken, whose color and start and end values ​​have been given separately.

LinearGaugeRange(
startValue: 0,
endValue: 33,
position: LinearElementPosition.outside,
color: Color(0xffF45656)),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Widget marker pointer:

Widget Marker Pointer We can use it as a marker in any type of flutter widget. As in this screen, we have used the marker pointer linear widget pointer inside which we have created a custom marker and given the value of value.

markerPointers: [
LinearWidgetPointer(
value:_pointerValue,
onValueChanged: (value) => {
setState(() => {_pointerValue = value})
},
child: Container(
height: 20,
width: 20,
decoration: BoxDecoration(color: Colors.blueAccent)
),
),
],

Code File:

import 'package:flutter/material.dart';
import 'package:flutter_linear_gauage_demo/route/route_names.dart';
import 'package:flutter_linear_gauage_demo/widget/custom_button.dart';
class LinearGauageHomePage extends StatefulWidget {
@override
_LinearGauageHomePageState createState() => _LinearGauageHomePageState();
}

class _LinearGauageHomePageState extends State<LinearGauageHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Linear Gauge Widget Demo'),
centerTitle: true,
),
body: Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomButton(
mainButtonText: 'Axis track',
callbackTertiary: () {
Navigator.of(context).pushNamed(RouteName.AxisTrackGuage);
},
color: Colors.green[200],
),
SizedBox(
height: 10,
),
CustomButton(
mainButtonText: 'Ticks and Labels',
callbackTertiary: () {
Navigator.of(context).pushNamed(RouteName.TicksLabelGuage);
},
color: Colors.blue[200],
),
SizedBox(
height: 10,
),
CustomButton(
mainButtonText: 'Ranges',
callbackTertiary: () {
Navigator.of(context).pushNamed(RouteName.RangesGuage);
},
color: Colors.orange[200],
),
SizedBox(
height: 10,
),
CustomButton(
mainButtonText: 'Shape marker pointer',
callbackTertiary: () {
Navigator.of(context).pushNamed(RouteName.ShapeMarkerPointer);
},
color: Colors.teal[200],
),
SizedBox(
height: 10,
),
CustomButton(
mainButtonText: 'Widget marker pointer',
callbackTertiary: () {
Navigator.of(context).pushNamed(RouteName.WidgetMarkerPointer);
},
color: Colors.green[200],
),
],
),
),
);
}
}

Conclusion:

In this article, I have explained a Linear Gauge Widget in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Linear Gauge Widget from our side.

I hope this blog will provide you with sufficient information in Trying up the Linear Gauge Widget in your flutter project. We will show you the Linear Gauge Widget is?, and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.

MultiImage Picker In Flutter

The flutter widget is built using a modern framework. It is like a reaction. In this, we start with the widget to create any application. Each component in the screen is a widget. The widget describes what his outlook should be given his present configuration and condition. Widget shows were similar to its idea and current setup and state. Flutter is a free and open-source tool to develop mobile, desktop, web applications with a single code base.

In this article, we will explore the Multiple Image Picker in flutter using the multiple_image_picker_package. With the help of the package, we can easily achieve a flutter number picker. So let’s get started.

multi_image_picker | Flutter Package
Flutter plugin that allows you to display multi-image picker on iOS and Android. Key Features * Documentation * FAQ *…pub.dev


Table Of Contents :

Multiple Image Picker

Implementation

Code Implement

Code File

Conclusion


Multiple Image Picker :

A multi-image picker library is used to select multiple images to show the selected image in the app, so we are going to use a multi-image picker library to select multiple images.

Demo Module :

Implementation :

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies :dependencies:
numberpicker: ^2.0.1

Step 2: Importing

import 'package:numberpicker/numberpicker.dart';

Step 3: Enable AndriodX

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

Step 4: Run flutter package get

Code Implementation :

Create a new dart file called multi_image_picker_demo.dart inside the libfolder.

First of all, we have created a list of the image.

List<Asset> images = <Asset>[];

Now we have defined a button, inside which there is a method named loadAssets, which has used the MultiImagePicker, which shows us by selecting the image.

ElevatedButton(
child: Text("Pick images"),
onPressed: loadAssets,
),

Before using the multi-image picker, create a list of build grid view builders inside which will show the selected image.

Container(
height:DeviceSize.height(context),
width:DeviceSize.width(context),
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children: <Widget>[
//Center(child: Text('Error: $_error')),
ElevatedButton(
child: Text("Pick images"),
onPressed: loadAssets,
),
Expanded(
child: buildGridView(),
),
],
),
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File :

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:multi_image_picker/multi_image_picker.dart';
import 'package:multi_image_picker_demo/themes/device_size.dart';

class MultipleImageDemo extends StatefulWidget {
@override
_MultipleImageDemoState createState() => _MultipleImageDemoState();
}

class _MultipleImageDemoState extends State<MultipleImageDemo> {
List<Asset> images = <Asset>[];

@override
void initState() {
super.initState();
}

Widget buildGridView() {
return GridView.count(
crossAxisCount: 3,
children: List.generate(images.length, (index) {
Asset asset = images[index];
return AssetThumb(
asset: asset,
width: 300,
height: 300,
);
}),
);
}

Future<void> loadAssets() async {
List<Asset> resultList = <Asset>[];
String error = 'No Error Detected';

try {
resultList = await MultiImagePicker.pickImages(
maxImages: 300,
enableCamera: true,
selectedAssets: images,
cupertinoOptions: CupertinoOptions(takePhotoIcon: "chat"),
materialOptions: MaterialOptions(
actionBarColor: "#abcdef",
actionBarTitle: "Example App",
allViewTitle: "All Photos",
useDetailsView: false,
selectCircleStrokeColor: "#000000",
),
);
} on Exception catch (e) {
error = e.toString();
}

if (!mounted) return;

setState(() {
images = resultList;
// _error = error;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Multiple Picker Image'),
),
body:Container(
height:DeviceSize.height(context),
width:DeviceSize.width(context),
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children: <Widget>[
//Center(child: Text('Error: $_error')),
ElevatedButton(
child: Text("Pick images"),
onPressed: loadAssets,
),
Expanded(
child: buildGridView(),
),
],
),
),
);
}
}

Conclusion:

In this flutter article, I have explained a Multi-Image Picker in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Image Pickerdemo from our side.

I hope this blog will provide you with sufficient information in Trying up the Image Picker in your flutter project. We will show you the Image Picker is?, and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Handling Navigation Stacks

Related: Building AI-Powered Image, Voice & Text Features in Flutter: A Practical Blueprint

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.

HUD Progress In Flutter

0

In flutter, we display any progress indicator because our application is busy or on hold, for this, we show a circular progress indicator. An overlay loading screen displays a progress indicator also called modal progress HUD or head-up display, which typically signifies that the app is loading or performing some work.

In this article, we will explore the HUD Progress in flutter using the hud_progress_package. With the help of the package, we can easily achieve hud progress flutter. So let’s get started.

flutter_progress_hud | Flutter Package
Highly
customizable modal progress indicator with a fade animation. Wrap with ProgressHUD the widget on top of which you…pub. dev


Table Of Contents :

Flutter

HUD Progress

Attributes

Implementation

Code Implement

Code File

Conclusion


Flutter :

“ Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time, Flutter offers great developer tools, with amazing hot reload”

HUD Progress :

The Flutter HUD Progress is a kind of progress indicator library that is like a circular progress indicator. Here HUD means a heads-up display ie a progress pop-up dialog will open above the screen which will have a circular progress indicator. Using this library we can use our flutter. The application can show a circular progress indicator.

Attributes:

Some Basic attributes.

  • > borderColor: The Border color property is used to change the indicator background border color.
  • > backgroundColor: The background-color property is used to change the color of the indicator background.
  • > indicatorColor: The background-color property is used to change the color of the indicator background.
  • > textStyle: The textStyle property is used for the text displayed below the indicator, in which the color and style of the text can be changed.

Demo Module :

Implementation :

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies :dependencies:
flutter_progress_hud: ^2.0.0

Step 2: Importing

import 'package:flutter_progress_hud/flutter_progress_hud.dart';

Step 3: Enable AndriodX

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

Create a new dart file called progress_hud_demo.dart inside the libfolder.

Before creating the Flutter HUD Progress, we wrapped a container with a Progress Hood followed by the Builder class. Inside we have used our widget and defined the border color and background color of the progress indicator. Let us understand this in detail.

ProgressHUD(
borderColor:Colors.orange,
backgroundColor:Colors.blue.shade300,
child:Builder(
builder:(context)=>Container(
height:DeviceSize.height(context),
width:DeviceSize.width(context),
padding:EdgeInsets.only(left:20,right:20,top:20),
),
),
),

Now we have taken a button, within which the indicator has set duration 5 seconds in indicator time Future. delayed() and displayed the text of the progress.

Container(
margin: EdgeInsets.only(
left:20.0, right:20.0, top:55.0),
child: CustomButton(
mainButtonText:'Submit',
callbackTertiary:(){
final progress = ProgressHUD.of(context);
progress.showWithText('Loading...');
Future.delayed(Duration(seconds:5), () {
progress.dismiss();
});
},
color:Colors.blue,
),
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File:

import 'package:flutter/material.dart';
import 'package:progress_hud_demo/shared/custom_button.dart';
import 'package:progress_hud_demo/shared/custom_text_field.dart';
import 'package:progress_hud_demo/themes/device_size.dart';
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
class ProgressHudDemo extends StatefulWidget {
@override
_ProgressHudDemoState createState() => _ProgressHudDemoState();
}

class _ProgressHudDemoState extends State<ProgressHudDemo> {
bool _isInAsyncCall = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor:Colors.white,
appBar:AppBar(
backgroundColor:Colors.blue,
title:Text('Flutter HUD Progress Demo'),
elevation:0.0,
),
body:ProgressHUD(
borderColor:Colors.orange,
backgroundColor:Colors.blue.shade300,
child:Builder(
builder:(context)=>Container(
height:DeviceSize.height(context),
width:DeviceSize.width(context),
padding:EdgeInsets.only(left:20,right:20,top:20),
child:Column(
crossAxisAlignment:CrossAxisAlignment.start,
children: [

Column(
crossAxisAlignment:CrossAxisAlignment.start,
children: [
Text('Sign In',style:TextStyle(fontFamily:'Roboto Bold',fontSize:27,fontWeight:FontWeight.bold),),
],
),

SizedBox(height:50,),

Column(
children: [
CustomTextField(hintText: 'Email', type:TextInputType.text, obscureText: false),

SizedBox(height:35,),

CustomTextField(hintText: 'Password', type:TextInputType.text, obscureText: true),
],
),

Container(
margin: EdgeInsets.only(
left:20.0, right:20.0, top:55.0),
child: CustomButton(
mainButtonText:'Submit',
callbackTertiary:(){
final progress = ProgressHUD.of(context);
progress.showWithText('Loading...');
Future.delayed(Duration(seconds:5), () {
progress.dismiss();
});
},
color:Colors.blue,
),
),

],
),
),
),
),
);
}
}

Conclusion:

In this article, I have explained a Flutter HUD Progress in a flutter, which you can modify and experiment with according to your own. This little introduction was from the Flutter HUD Progress from our side.

I hope this blog will provide you with sufficient information in Trying up the Flutter HUD Progress in your flutter project. We will show you what the Flutter HUD Progress is? and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: SMS Using Twilio In Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.


Scrollbar Widget In Flutter

0

Today mobile users expect their apps should have a beautiful UI design, smooth animations, and great performance. To achieve this developer needs to create a new feature without compromising on quality and performance. That’s why Google build Flutter.

Flutter allows you to make lovely, natively compiled applications. The explanation Flutter can do this is that Flutter loves Material. Material is a plan framework that helps assemble high-quality, digital encounters. As UI configuration keeps developing, Material keeps on refreshing its components, motion, and plan framework.

In this article, I’ll explain how to show Scrollbar in a scrollable widget in Flutter. We’ll need enough information on a single screen. So, here we need something to scroll up and scroll down.


Table of Contents :

Flutter — Introduction

Widgets — Introduction

Scrollbar

Code Implementation

Code File

Conclusion


What is Flutter?

Flutter is Google’s open-source UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

If you want to explore more about Flutter, please visit Flutter’s official website to get more information.

Widgets:

Widget is a way to declare UI in a flutter. Flutter provides several widgets that help you build apps that follow Material Design that takes inspiration from React. The central idea is that you build your UI out of widgets. Widgets describe what their view should look like given their current configuration and state.

Scrollbar:

By default, scrollable widgets in Flutter don’t show a scrollbar. To add a scrollbar to a ScrollView, wrap the scroll view widget in a Scrollbar widget. Using this widget we can scroll a widget.

The scrollbar allows the user to jump into the particular points and also shows how far the user reaches.

For more info on Scrollbar Widget ,Watch this video By Flutter :

Constructor:

Creates a material design scrollbar that by default will connect to the closest Scrollable descendant of the child.

Scrollbar(
{Key? key,
required Widget child,
ScrollController? controller,
bool? isAlwaysShown,bool? showTrackOnHover,
double? hoverThickness,double? thickness,
Radius? radius,
ScrollNotificationPredicate? notificationPredicate}
),

Code implementation:

Let’s move on the coding part

In this snippet, We used listview and wrapped it into Scrollbar. In this, isAlwaysShown is a bool it indicates that the scrollbar should be visible, even when a scroll is not underway, and showTrackOnHover Controls if the track will show on hover and remain, including during drag.

Expanded(
child: Scrollbar(
isAlwaysShown: _isAlwaysShown,
showTrackOnHover: _showTrackOnHover,
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index) => MyItem(index),
),
),
),

We will add ListView.builder() method. In this method, we will add itemCount was a non-null and tells the ListView how many list items there will be. itemBuilder’ will be called distinctly with indices greater than or equivalent to zero and not exactly ‘itemCount.’ The function provides the BuildContext as the context parameter and the item position as the index parameter. The whole code will be defined in below code file.

Code File:

import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primaryColor: Colors.white,
),
debugShowCheckedModeBanner: false,
home: MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
bool _isAlwaysShown = true;

bool _showTrackOnHover = false;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Scrollbar Demo' ),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Scrollbar(
isAlwaysShown: _isAlwaysShown,
showTrackOnHover: _showTrackOnHover,
hoverThickness: 30.0,
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index) => MyItem(index),
),
),
),
Divider(height: 1),
],
),
);
}
}

class MyItem extends StatelessWidget {
final int index;

const MyItem(this.index);

@override
Widget build(BuildContext context) {
final color = Colors.primaries[index % Colors.primaries.length];
final hexRgb = color.shade500.toString().substring(10, 16).toUpperCase();
return ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
leading: AspectRatio(
aspectRatio: 1,
child: Container(
color: color,
)),
title: Text('Material Color #${index + 1}'),
subtitle: Text('#$hexRgb'),
);
}
}

When we run the application, we ought to get the screen’s output like the underneath screen video.

Final Output

Conclusion:

In this article, I have explained the Scrollbar widget demo, which you can modify and experiment with according to your own. This little introduction was about adding a scrollbar in the Scrollable widget.

I hope this blog will provide you with sufficient information in trying up Scrollbar Widgets in your flutter projects. We will show to add scrollbar in a Listview, jump into the particular point, and make a demo program for working Scrollbar in your flutter applications. So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Expansible Widget In Flutter

Related: Cupertino Scrollbar In Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.


A-Z Header Builder In Flutter

0

In this blog, we shall learn how to implement A-Z header logic on a firebase snapshot containing a list of documents. This functionality is very helpful to the users as it makes it convenient for the users to find the data in a long list using the header title. We will be building the logic to display the header text on the top of the list data containing elements of that specific header. (eg. If the header is “A” then it will show the only element that starts with “A” and like a vise)


Table of contents:

What is flutter?

Connect your app with firebase

Create a collection of users on firebase that contains the data of the users

Install the following dependencies

Initialize the Firebase in your main method

List of users inside the builder method

Fetch the list of users from the database to your app

Initialize the variable outside the build method

UserCard widget

App Screenshot


What is Flutter?

Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time.

Flutter – Beautiful native apps in record time
Paint your app to life in milliseconds with Stateful Hot Reload. Use a rich set of fully customizable widgets to build…flutter. dev

Connect your app with firebase.

How to integrate firebase with flutter android or ios app ?

  1. Open firebase, click on get started which will take you to the Add Project screen.
  2. Enter the project name and complete the other essential steps. It will take you to your project screen, click on the android icon.
  3. Now the steps which are coming are very important so please do them very carefully. You have to enter the package name which is generally your application Id in your app-level build. Gradle file. Add the other two optional fields if you wish to add them as well.
  4. Now download the google-services.json. Move the downloaded google-serivces.json file into your Android app module root directory. (NOTE: Please check the file that you have downloaded has a google-services.json name or not because if you download it more than one time the name of the file changes to google-services(2).json, so please remove (2) from the file name or rename it to google-services.json)
  5. You will see the following screen.

Here the first block contains the classpath that you have to add to your project-level build. Gradle file under the dependencies section. The second section contains a plugin and dependencies that you have to add to your project app-level build. Gradle file. Please add these lines properly and carefully if you are adding them for the first time.

Left: project/build.gradle ….Right :project/app/build.gradle

6. Now you should restart your application (NOTE: Please refer to full restart not hot reload). Wait for few seconds and your application will be successfully added with firebase. If you see the bellow screen on your firebase then you have successfully added firebase to your app…

Create a collection of users on firebase that contains the data of the users.

Install the following dependencies.

cloud_firestore: ^0.14.0+2
firebase_core: ^0.5.0

Initialize the Firebase in your main method.

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}

Fetch the list of users from the database to your app.

StreamBuilder is a stateful widget that can listen to streams and return widgets and capture snapshots of received stream data from the database.

We will fetch the collection users and we will order it according to the username field.

StreamBuilder(
stream: FirebaseFirestore.instance
.collection('users')
.orderBy("username")
.snapshots(),
builder: (context, userSnapshot) {
return ;
},
)

List of users inside the builder method.

StreamBuilder(
stream: FirebaseFirestore.instance
.collection('users')
.orderBy("username")
.snapshots(),
builder: (context, userSnapshot) {
return userSnapshot.hasData
? ListView.builder(
itemCount: userSnapshot.data.documents.length,
itemBuilder: (context, index) {
DocumentSnapshot userData =
userSnapshot.data.documents[index];

return UserCard(
userId: userData.data()['userId'],
userEmail: userData.data()['email'],
userName: userData.data()['username'],
userLaundryBagNo:
userData.data()['laundryBagNo'],
userImageUrl: userData.data()['image_url']);
})
: CircularProgressIndicator();
},
),

Initialize the variable outside the build method

String header;
String username;
String _username;
String currentHeader;

Logic: To implement the following functionality we need to get the username of the current index and the username of the previous index i.e. index-1 and we will store it into _username. We will assign both the username substring to two different variables currentheader and header respectively. Now we will compare both the header if they are equal then the Usercard widget will be displayed if not then the Column of the Header text and Usercard widget will be displayed.

ListView.builder(
itemCount: userSnapshot.data.documents.length,
itemBuilder: (context, index) {
DocumentSnapshot _userData = index == 0
? userSnapshot.data.documents[index]
: userSnapshot.data.documents[index - 1];

DocumentSnapshot userData =
userSnapshot.data.documents[index];

username = userData.data()['username'];
_username = index == 0
? userData.data()['username']
: _userData.data()['username'];
currentHeader = username.substring(0, 1);
header = index == 0
? username.substring(0, 1)
: _username.substring(0, 1);
 if (index == 0 || index == 0
? true
: (header != currentHeader)) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
left: 30, top: 10, bottom: 10),
child: Text(
currentHeader,
style: TextStyle(
fontWeight: FontWeight.bold),
)),
UserCard(
userId: userData.data()['userId'],
userEmail: userData.data()['email'],
userName: userData.data()['username'],
userLaundryBagNo:
userData.data()['laundryBagNo'],
userImageUrl:
userData.data()['image_url'])
],
);
} else {
return UserCard(
userId: userData.data()['userId'],
userEmail: userData.data()['email'],
userName: userData.data()['username'],
userLaundryBagNo:
userData.data()['laundryBagNo'],
userImageUrl: userData.data()['image_url']);
}
})

UserCard widget

import 'package:flutter/material.dart';
import 'package:laundary_wender_application/userOrderPage.dart';

class UserCard extends StatelessWidget {
final String userImageUrl;
final String userLaundryBagNo;
final String userName;
final String userEmail;
final String userId;

UserCard({
@required this.userEmail,
@required this.userName,
@required this.userId,
@required this.userLaundryBagNo,
@required this.userImageUrl,
});

@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (_) {
return UserOrderPage(
userId: userId,
);
}));
},
child: Card(
child: Container(
height: 100,
width: MediaQuery.of(context).size.width,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Row(
children: [
CircleAvatar(
backgroundImage: NetworkImage(userImageUrl),
radius: 30,
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
userLaundryBagNo,
style: TextStyle(
fontWeight: FontWeight.w900,
fontSize: 20,
),
),
Text(
userName,
style: TextStyle(
fontWeight: FontWeight.w700, color: Colors.grey),
),
Text(
userEmail,
style: TextStyle(
fontWeight: FontWeight.w500, color: Colors.grey),
)
],
),
),
],
),
),
),
),
);
}
}

Demo Screenshot

🌸🌼🌸 Thank you for reading. 🌸🌼🌸


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app 987tr project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences!.

Related: SMS Using Twilio In Flutter

Related: Using SharedPreferences in Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.

Pin Code Fields In Flutter

Flutter is Google’s UI tool stash for making excellent, natively compiled iOS and Android applications from a single code base. To construct any application, we start with widgets — The building square of flutter applications. Widgets portray what their view ought to resemble given their present design and state. It incorporates a text widget, row widget, column widget, container widget, and some more.

In this article, we will explore the Pin Code Fileds in flutter using the flutter_pin_code_fields_package. With the help of the package, we can easily achieve flutter pin code fields. So let’s get started.


Table Of Contents :

Flutter

Pin Code Fileds

Attributes

Implementation

Code Implement

Code File

Conclusion


Flutter :

“ Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time, Flutter offers great developer tools, with amazing hot reload”

Pin Code Fields :

The flutter pin code Fields library helps us to create a customizable field, we use it for any login pin or OTP. In this library, we can make the input text of animated type.

Demo Module :

Attributes:

Some Basic Attributes:

  • > length: We use the length property to define the total pin code field.
  • > fieldHeight: We use the field height property to reduce and increase the height of the field.
  • > fieldWidth: We use the field width property to reduce and increase the width of the field.
  • > obscureText: Use the obscure text property to hide the user’s input text.
  • > margin: The margin property provides margin between fields.
  • > padding: The padding property provides padding between fields.

Implementation :

You need to implement it in your code respectively :

Step 1: Add dependencies.

Add dependencies to pubspec — yaml file.

dependencies:
flutter_pin_code_fields: ^1.1.0

Step 2: import the package :

import 'package:flutter_pin_code_fields/flutter_pin_code_fields.dart';

Step 3: Run flutter package get

How to implement code in dart file :

Create a new dart file called pin_code_filed_demo.dart inside the libfolder.

Before using Flutter Pincode Fields, we have taken a container whose column widget is used, inside it the default Pincode Fields, Obscure Fields, Custom Pin Code Fields, and Animated Fields.

Text(
'Default Pincode Fields',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 40.0,
),
PinCodeFields(
length: 4,
controller: newTextEditingController,
focusNode: focusNode,
onComplete: (result) {
// Your logic with code
print(result);
},
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File :

import 'package:flutter/material.dart';
import 'package:flutter_pin_code_fields/flutter_pin_code_fields.dart';
class FlutterPinCodeFields extends StatefulWidget {
@override
_FlutterPinCodeFieldsState createState() => _FlutterPinCodeFieldsState();
}

class _FlutterPinCodeFieldsState extends State<FlutterPinCodeFields> {
TextEditingController newTextEditingController = TextEditingController();
FocusNode focusNode = FocusNode();

@override
void dispose() {
newTextEditingController.dispose();
focusNode.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Pin Code Fields Demo'),
),
body: Container(
margin:EdgeInsets.only(left:20,right:20),
child:SingleChildScrollView(
child:Column(
children: <Widget>[
SizedBox(
height: 30.0,
),
Text(
'Default Pincode Fields',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 40.0,
),
PinCodeFields(
length: 4,
controller: newTextEditingController,
focusNode: focusNode,
onComplete: (result) {
// Your logic with code
print(result);
},
),
SizedBox(
height: 80.0,
),
Text(
'Obscure Pincode Fields',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10.0,
),
PinCodeFields(
length:4,
obscureText: true,
obscureCharacter: '❌',
onComplete: (text) {
// Your logic with pin code
print(text);
},
),
SizedBox(
height: 80.0,
),
Text(
'Custom Pincode Fields',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10.0,
),
PinCodeFields(
length: 4,
fieldBorderStyle: FieldBorderStyle.Square,
responsive: false,
fieldHeight:40.0,
fieldWidth: 40.0,
borderWidth:1.0,
activeBorderColor: Colors.pink,
activeBackgroundColor: Colors.pink.shade100,
borderRadius: BorderRadius.circular(10.0),
keyboardType: TextInputType.number,
autoHideKeyboard: false,
fieldBackgroundColor: Colors.black12,
borderColor: Colors.black38,
textStyle: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
onComplete: (output) {
// Your logic with pin code
print(output);
},
),
SizedBox(
height: 80.0,
),
Text(
'Animated Pincode Fields',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 10.0,
),
PinCodeFields(
length: 4,
animationDuration: const Duration(milliseconds: 200),
animationCurve: Curves.easeInOut,
switchInAnimationCurve: Curves.easeIn,
switchOutAnimationCurve: Curves.easeOut,
animation: Animations.SlideInDown,
onComplete: (result) {
// Your logic with code
print(result);
},
),
SizedBox(
height: 50.0,
),
],
),
),
),
);
}
}

Conclusion :

In this article, I have explained a Pin Code Fields in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Pin Code Fields from our side.

I hope this blog will provide you with sufficient information in Trying up the Pin Code Fields in your flutter project. We will show you the Pin Code Fields is?, and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Code Splitting & Lazy Loading in Flutter: Speeding Up App Startup Times

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.

CupertinoActionSheet In Flutter

0

All mobile applications delivering some common characteristic. One quite obvious behavior is to provide users to make decisions or choose options, while needed. To achieve this we’ve some pre-built functionality.

Hello Guys, In this tutorial, we’ll learn about how to implement CupertinoActionSheet in Flutter.


Table of Contents :

Introduction

Setup

Code Implementation

Code File

Conclusion


Introduction:

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Using Flutter we can build

If you want to explore more about Flutter, please visit Flutter’s official website to get more information.

CupertinoActionSheet

According to flutter doc, An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. To build an ios-style app to present the list option we’ll use CupertinoActionSheet.

Setup:

First of all, we have to import the Cupertino package into our dart file.

import 'package:flutter/cupertino.dart;

CupertinoActionSheet is an ios-themed widget that has action sheets design specifications. An action sheet can have a title, an additional message, and a list of actions. To display action buttons that look like standard iOS action sheet buttons, provide CupertinoActionSheetActions for the actions given to this action sheet.

To include an iOS-style cancel button separate from the other buttons, provide a CupertinoActionSheetAction for the cancelButton given to this action sheet. An action sheet is typically passed as the child widget to showCupertinoModalPopup, which displays the action sheet by sliding it up from the bottom of the screen.

Constructors:

CupertinoActionSheet({Key? key,
Widget? title,
Widget? message,
List<Widget>? actions,
ScrollController? messageScrollController,
ScrollController? actionScrollController,
Widget? cancelButton})

Properties:

  1. actions-> List<Widgets>: The set of actions that are displayed for the user to select.
  2. actionScrollControllerScrollController: A scroll controller that can be used to control the scrolling of the actions in the action sheet
  3. cancelButton → Widget: The optional cancel button that is grouped separately from the other actions
  4. message → Widget: An optional descriptive message that provides more details about the reason for the alert.
  5. title → Widget: An optional title of the action sheet. When the message is non-null, the font of the title is bold.

Code implementation:

In this snippet on click of a button, we’ve added CupertinoActionSheet. We can use it anywhere in the class.

showCupertinoModalPop

showCupertinoModalPopup(
context: context,
builder: (BuildContext context) => CupertinoActionSheet());

Now added title, message, actions, and cancelButton. These are the properties.

To show particular option item in action we used CupertinoActionSheetAction() widget.

CupertinoActionSheetAction(
child: const Text('Option 1'),
onPressed: () {
//do some action
}
);

Code file

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}

class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("CupertinoActionSheet"),
),
body: Center(
child: ElevatedButton(
onPressed: () {
final action = CupertinoActionSheet(
title: Text(
"Flutter dev",
style: TextStyle(fontSize: 30),
),
message: Text(
"Select any action ",
style: TextStyle(fontSize: 15.0),
),
actions: <Widget>[
CupertinoActionSheetAction(
child: Text("Action 1"),
isDefaultAction: true,
onPressed: () {
print("Action 1 is been clicked");
},
),
CupertinoActionSheetAction(
child: Text("Action 2"),
isDestructiveAction: true,
onPressed: () {
print("Action 2 is been clicked");
},
)
],
cancelButton: CupertinoActionSheetAction(
child: Text("Cancel"),
onPressed: () {
Navigator.pop(context);
},
),
);

showCupertinoModalPopup(
context: context, builder: (context) => action);
},
child: Text("Click me "),
),
),
);
}
}

Output

Conclusion:

In this article, I have explained the CupertinoActionSheet widget demo, which you can modify and experiment with according to your own. This little introduction was about showing an ios-styled theme in the app.

I hope this blog will provide you with sufficient information in trying up CupertinoActionSheet Widgets in your Flutter projects. So please try it.

❤ ❤ Thanks for reading this article ❤❤


If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.

From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: SMS Using Twilio In Flutter

Related: Using SharedPreferences in Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.


Inherited Widget In Flutter

0

Flutter has made it quite easy to develop complex UIs for developers. Pulsation automated testing empowers you to meet high responsiveness in your application as it helps in discovering bugs and various issues in your application. Pulsation is a tool for developing mobile, desktop, web applications with a code & is a free and open-source tool.

Hello friends, I will talk about my new blog on Inherited Widget In Flutter. We will also implement a demo of the Inherited Widget, and describes its properties, and how to use them in your flutter applications. So let’s get started.


Table Of Contents :

Inherited Widget

Attributes

Code Implement

Code File

Conclusion


Inherited Widget :

In flutter, the inherited widget is a base class that allows those classes to extend the information under the tree from it. Inherited widgets are also a kind of state management technique. It works by telling registered build references when a change occurs. However, it adds interoperability to any app in a secure way, but when doing so it can Re-create each widget atop the tree.

Demo Module :

Attributes

Let’s talk about some main constructors of Inherited Widget.

const InheritedWidget({
Key? key, required Widget child
})
: super(key: key, child: child);

child: We use the child property to use widgets like row, column stack, etc. so that we can exclude many children.

key: The key property is a one-of-a-kind parameter. Basically, every widget creator can be found if the two widget’s runtime type and key property are is equal respectively, then the new widget updates the old widget by calling it the underlying element. Otherwise, the old element is updated. The tree is removed from the tree, the new widget is converted to an element, and the new element is inserted into the tree.

Code Implementation:

You need to implement it in your code respectively:

Create a new dart file calledcount_state_demo inside the lib folder.

Before using the Inherited widget we have created a class named Constant that extends the Inherited widget It overrides the updateShouldNotify method used to get the closest widget to the information from the given BuildContext.

class CountState extends InheritedWidget {

final int count;
final Widget child;
final Function addCounter;
final Function removeCounter;

CountState({Key key, this.count,this.child, this.addCounter,this.removeCounter})
: super(key: key, child: child);

static CountState of(BuildContext context) {
return (context.dependOnInheritedWidgetOfExactType<CountState>());
}

@override
bool updateShouldNotify(CountState oldWidget) {
//return true;
return count != oldWidget.count;
}
}

This method has to be canceled before the inherited widget can be overridden updateShouldNotify method. This method has been used so that the widget received from this widget must be notified or not. It is of type Boolean and accepts a parameter that Is similar to a square

@override
bool updateShouldNotify(CountState oldWidget) {
//return true;
return count != oldWidget.count;
}

Now we will initialize the count state in the RootWidget class and initialize the addCounter and removeCounter functions, then we will define the InheritedWidgeDemo class which will display the value of the counter which has two buttons that will be clicked on and add value and remove value.

return CountState(
count: count,
addCounter: addCounter,
removeCounter: removeCounter,
child: InheritedWidgetDemo(),
);

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File:

import 'package:flutter/material.dart';
import 'package:flutter_inherited_widget_demo/view/count_state.dart';

class RootWidget extends StatefulWidget {
@override
_RootWidgetState createState() => _RootWidgetState();
}

class _RootWidgetState extends State<RootWidget> {
int count = 0;
void addCounter() {
setState(() {
count++;
});
}

void removeCounter() {
setState(() {
if(count>0){
count--;
}
});
}

@override
Widget build(BuildContext context) {
return CountState(
count: count,
addCounter: addCounter,
removeCounter: removeCounter,
child: InheritedWidgetDemo(),
);
}
}

class InheritedWidgetDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final counterState = CountState.of(context);
return Scaffold(
appBar: AppBar(
backgroundColor:Colors.blue,
title: Text(
'Counter Inherited Widget Demo',
style: TextStyle(color: Colors.white),
),
),

body: Column(
mainAxisAlignment:MainAxisAlignment.spaceEvenly,
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child:Text('Items add & remove: ${counterState.count}',
style: TextStyle(fontSize: 20),
),
),

Row(
mainAxisAlignment:MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Align(
alignment: Alignment.bottomLeft,
child: new FloatingActionButton(
onPressed: counterState.removeCounter,
child: new Icon(
Icons.remove,
color: Colors.white,
),
),
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Align(
alignment: Alignment.bottomCenter,
child: new FloatingActionButton(
onPressed: counterState.addCounter,
child: new Icon(
Icons.add,
color: Colors.white,
),
),
),
),
],
),
],
),
);
}
}

Conclusion:

In this article, I have explained an Inherited Widget in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Inherited Widget demo from our side.

I hope this blog will provide you with sufficient information in Trying up the Inherited Widget in your flutter project. We showed you what the Inherited Widget is and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.

From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Streamlining Payments In Flutter

Related: Exploring StreamBuilder In Flutter

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.

Wall Layout In Flutter

In this article, we will explore the Wall Layout In flutter using the wall_layout_package. With the help of the package, we can easily achieve the flutter Wall Layout. So let’s get started.

flutter_wall_layout | Flutter Package
This library provides a unique
widget, WallLayout, rendering into a list of children having different shapes. There is two…pub.dev


Table of Contents :

Flutter

Wall Layout

Implementation 

Code Implementation

Code File

Conclusion


Flutter :

“ Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time, Flutter offers great developer tools, with amazing hot reload”

Wall Layout :

If you want to display a few elements in a specific way without scroll, you may not need WallLayout, and you should look at Stack, Row, Column, Expanded widgets. They may be easier to handle.

Wall Layout advantages are best shown on a big set of rectangle widgets having different sizes. It may appear interesting for a few uses, but you may keep your code as simple as possible, isn’t it?.

Demo Module :

Implementation :

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies :dependencies:
flutter_wall_layout: ^1.0.0

Step 2: Importing

import 'package:flutter_wall_layout/flutter_wall_layout.dart';

Step 3: Run flutter package get

Code Implementation :

Create a new dart file called image_wall_layout_demo.dart inside the libfolder.

Before creating the wall layout, we have created a list of an image and defined the image list data in the _createPicture() method, and initialized the image list to initState().

List<_MyPictureData> _picturesData;@override
void initState() {
super.initState();
_animationController = AnimationController(duration: Duration(milliseconds: 2000), vsync: this);
_picturesData = _createPicturesData();
_animationController.forward(from: 0.0);
}

Now we will take the WallLayout widget inside which to use its properties. Inside the WallLayout, we have defined the _buildList() method in the stones() property, inside which we used the animation which will animate our image and tap again on the refresh icon in the app bar. Refresh the image and display it.

WallLayout(
stones: _buildList(),
layersCount: 3,
stonePadding: 12.0,
),

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Code File:

import 'package:flutter/material.dart';
import 'package:flutter_wall_layout/flutter_wall_layout.dart';
import 'dart:math';

class ImageWallLayout extends StatefulWidget {
@override
_ImageWallLayoutState createState() => _ImageWallLayoutState();
}

class _ImageWallLayoutState extends State<ImageWallLayout>
with TickerProviderStateMixin {
AnimationController _animationController;
List<_MyPictureData> _picturesData;

@override
void initState() {
super.initState();
_animationController = AnimationController(
duration: Duration(milliseconds: 2000), vsync: this);
_picturesData = _createPicturesData();
_animationController.forward(from: 0.0);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(
"Wall Layout Demo",
style: TextStyle(color: Colors.black),
),
centerTitle: true,
// leading: IconButton(icon: Icon(Icons.swap_horizontal_circle), onPressed: __swapLayout,),
actions: [
IconButton(
icon: Icon(
Icons.replay,
color: Colors.black,
),
onPressed: __replayAnimation)
],
),
body: WallLayout(
stones: _buildList(),
layersCount: 3,
stonePadding: 12.0,
),
);
}

void __swapLayout() {
Navigator.of(context).popAndPushNamed("usecase2");
}

void __replayAnimation() {
_animationController.forward(from: 0.0);
setState(() {});
}

List<_MyPictureData> _createPicturesData() {
final data = [
{"name": "assets/images/resort_1.jpg", "width": 1, "height": 1},
{"name": "assets/images/resort_2.jpg", "width": 2, "height": 1},
{"name": "assets/images/resort_3.jpg", "width": 1, "height": 2},
{"name": "assets/images/resort_4.jpg", "width": 1, "height": 1},
{"name": "assets/images/resort_1.jpg", "width": 2, "height": 2},
{"name": "assets/images/resort_2.jpg", "width": 1, "height": 1},
{"name": "assets/images/resort_3.jpg", "width": 1, "height": 1},
{"name": "assets/images/resort_1.jpg", "width": 2, "height": 1},
{"name": "assets/images/resort_2.jpg", "width": 1, "height": 2},
{"name": "assets/images/resort_3.jpg", "width": 2, "height": 2},
{"name": "assets/images/resort_4.jpg", "width": 1, "height": 1},
{"name": "assets/images/resort_1.jpg", "width": 3, "height": 1},
];
double length = data.length.toDouble();
final firstEnd = 0.35;
return data.map((d) {
final isFirst = data.indexOf(d) == 0;
double pos = data.indexOf(d).toDouble();
return _MyPictureData(
name: d["name"],
width: d["width"],
height: d["height"],
animatable: CurveTween(
curve: Interval(
isFirst ? 0.0 : (firstEnd + (pos / length) * (1.0 - firstEnd)),
isFirst
? firstEnd
: min(1.0,
firstEnd + ((pos + 1.0) / length) * (1.0 - firstEnd)),
curve: isFirst ? Curves.elasticOut : Curves.easeOutBack,
),
));
}).toList();
}

List<Stone> _buildList() {
return _picturesData.map((d) {
return Stone(
id: _picturesData.indexOf(d),
width: d.width,
height: d.height,
child: ScaleTransition(
scale: d.animatable.animate(_animationController),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0),
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage(d.name),
),
),
),
),
);
}).toList();
}
}

class _MyPictureData {
final String name;
final int width;
final int height;
final Animatable animatable;

_MyPictureData({this.name, this.width, this.height, this.animatable});
}

Conclusion:

In this flutter article, I have explained a Wall Layout in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Feature Wall Layout demo from our side.

I hope this blog will provide you with sufficient information on Trying up the Wall Layout in your flutter project. We will show you the Wall Layout is?, and work on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Related: Explore Layout Inspector In Flutter

Related: Dark Mode Implementation

Need expert help building your Flutter app? Talk to FlutterExperts for architecture, development, and consulting support.