Google search engine
Home Blog Page 75

SQFlite In Flutter

0

SQFlite is a plugin in flutter which is used to store the data. In SQFlite we perform many operations like create, delete, update, etc. This operation is called CRUD Operations. Using this we can easily store the data in a local database.


Table Of Contents::

Introduction

AddDependency

Create Database

Create Model Class

CURD Operations

Implementation

Conclusion

GitHub Link


Introduction:

There are many ways to store the data in flutter but SQFlite is a very easy plugin to store the data locally. SQFlite plugin supports IOS, Android, and macOS. SQFLite is one of the most used and up-to-date packages for linking to SQLite databases in Flutter.


Add Dependency:

In your project go to the pubspec. yaml and add the dependencies under the dependencies: add the latest version of sqflite, into, and flutter_staggered_grid_view.

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
sqflite: ^2.0.0+3
intl: ^0.17.0
flutter_staggered_grid_view: ^0.4.0-nullsafty.3

We use sqflite for database storage, intl is used for DateTime format and flutter_staggered_grid_view is used for display todos in the grid.


Create Database:

  • > Create Database: We need to open a connection of the database to reach and write data. And for this, we create a database, and inside of it we want to return our database in case it already exists however if it does not exist then we need to initialize our database and for that, we create new file notes. db and in this we store database. and return the database so that can later make use of it.
Future<Database> get database async {
if (_database != null) return _database!;

_database = await _initDB('notes.db');
return _database!;
}
  • > Initialize Database: For initialize database we add a new method where we get the file path. and store our database in our file storage system.
Future<Database> _initDB(String filePath) async {
final dbPath = await getDatabasesPath();
final path = join(dbPath, filePath);

return await openDatabase(path, version: 1, onCreate: _createDB);
}
  • > Database Method: we create a _createDB method inside openDatabase(). And inside this method we want to call the database execute method(), we can put our create table statement and define the structure of our table.
Future _createDB(Database db, int version) async {
final idType = 'INTEGER PRIMARY KEY AUTOINCREMENT';
final textType = 'TEXT NOT NULL';
final boolType = 'BOOLEAN NOT NULL';
final integerType = 'INTEGER NOT NULL';

await db.execute('''
CREATE TABLE $tableNotes (
${NoteFields.id} $idType,
${NoteFields.isImportant} $boolType,
${NoteFields.number} $integerType,
${NoteFields.title} $textType,
${NoteFields.description} $textType,
${NoteFields.time} $textType
)
''');
}

Create Model Class:

We create a class Note and here inside we add all the fields which we want to store in our database. To store our node we need to create a table. So we create table name notes.

class Note {
final int? id;
final bool isImportant;
final int number;
final String title;
final String description;
final DateTime createdTime;

const Note({
this.id,
required this.isImportant,
required this.number,
required this.title,
required this.description,
required this.createdTime,
});

And all the fields which we want to create. For that, we create a new class NoteFields in which we define our field name.


CURD Operations:

> Create:

The Sqflite package provides two ways to hold these operations using RawSQL queries or by using table name and a map that contains the data :

rawInsert:

Future<Note> create(Note note) async {
final db = await instance.database;
final json = note.toJson();
final columns =
'${NoteFields.title}, ${NoteFields.description}, ${NoteFields.time}';
final values =
'${json[NoteFields.title]}, ${json[NoteFields.description]}, ${json[NoteFields.time]}';
final id = await db
.rawInsert('INSERT INTO table_name ($columns) VALUES ($values)');
return note.copy(id: id);
}

Insert:

Future<Note> create(Note note) async {
final db = await instance.database;
final id = await db.insert(tableNotes, note.toJson());
return note.copy(id: id);
}

> Read:

We create a ReadNote and pass id in it. which we have before generated and if you pass down the id inside then we can get from our database the note object again. We define our database and then create a method query(), first we add a table(tableNotes) inside and define all the columns. Create a value list in NoteFiels class. and define which note object you want to read. Use where and whereArgs which prevents SQL injection attacks.

Future<Note> readNote(int id) async {
final db = await instance.database;

final maps = await db.query(
tableNotes,
columns: NoteFields.values,
where: '${NoteFields.id} = ?',
whereArgs: [id],
);

if (maps.isNotEmpty) {
return Note.fromJson(maps.first);
} else {
throw Exception('ID $id not found');
}
}

> Update:

To update our notes we use the update Curd operation. By which we can update the text. ER create an update method in which we pass note object inside. Add the database reference and return the update method and as same we need to define the table which we want to update and secondly, we need to pass the note object and pass JSON object inside.

Future<int> update(Note note) async {
final db = await instance.database;

return db.update(
tableNotes,
note.toJson(),
where: '${NoteFields.id} = ?',
whereArgs: [note.id],
);
}

> Delete:

When we need to delete our object so we use the delete Curd operation. For deleting anything we need to create a method which name is delete(). And pass the note object, therefore we simply call here this method db. delete() and define here a table which we want to delete and lastly we define which object we want to delete.

Future<int> delete(int id) async {
final db = await instance.database;

return await db.delete(
tableNotes,
where: '${NoteFields.id} = ?',
whereArgs: [id],
);
}

Implementation:

In the SQFlite demo first, we take a stateful class. and define a list which name is notes and a bool variable isLoading. after that we create a method refreshNotes() in which we pass isLoading is true and refresh readallnotes(),

Future refreshNotes() async {
setState(() => isLoading = true);

this.notes = await NotesDatabase.instance.readAllNotes();

setState(() => isLoading = false);
}

And pass this method to initstate(). In the BuildContext() we pass the Scaffold and use the property of the appbar. In the body, we pass a method which is buildNotes(), In this method, we pass StaggeredGridView.countBuilder() IN this weight we show all the card which is created, and if there is no card so it shows an empty screen.

Widget buildNotes() => StaggeredGridView.countBuilder(
padding: EdgeInsets.all(8),
itemCount: notes.length,
staggeredTileBuilder: (index) => StaggeredTile.fit(2),
crossAxisCount: 4,
mainAxisSpacing: 4,
crossAxisSpacing: 4,
itemBuilder: (context, index) {
final note = notes[index];

return GestureDetector(
onTap: () async {
await Navigator.of(context).push(MaterialPageRoute(
builder: (context) => NoteDetailPage(noteId: note.id!),
));

refreshNotes();
},
child: NoteCardWidget(note: note, index: index),
);
},
);

At the bottom, we create a FloatingActionButton() which is used for creating new notes. On the click at FloatingActionButton(), its navigate to the AddEditNotePage().

In the AddEditNotePage() we create a form() in which we write our text and we pass a button which name is saved, it is used to save the text. For this, we create a method which name is buildButton() in this we check whether it isFormValid or not.

Widget buildButton() {
final isFormValid = title.isNotEmpty && description.isNotEmpty;

return Padding(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
onPrimary: Colors.white,
primary: isFormValid ? null : Colors.grey.shade700,
),
onPressed: addOrUpdateNote,
child: Text('Save'),
),
);
}

In the appbar we define two buttons one is for update and the other one is for deleting the notes. To edit the note we create a method editButton(). at the click of this button, we navigate to the edit page and after editing this its refreshes the page.

Widget editButton() => IconButton(

icon: Icon(Icons.edit_outlined),
onPressed: () async {
if (isLoading) return;

await Navigator.of(context).push(MaterialPageRoute(
builder: (context) => AddEditNotePage(note: note),
));

refreshNote();
});

And the other button which is used for deleting notes, we create a method deleteButton() in which we delete the instance of the note.

Widget deleteButton() => IconButton(
icon: Icon(Icons.delete),
onPressed: () async {
await NotesDatabase.instance.delete(widget.noteId);

Navigator.of(context).pop();
},
);

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


Conclusion:

In this article, we have been through What is SQFlite in Flutter along with how to implement it in a Flutter. By using we can perform many curd orations. And we can easily add or delete the database locally.

❤ 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.


GitHub Link:

Find the source code of the SQFlite In Flutter :

GitHub – flutter-devs/flutter_sqflite
A new Flutter project. This project is a starting point for a Flutter application. A few resources to get you started…github.com


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 Precache Images In Flutter

Related: Hive NoSql Database

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


Linear Progress Indicator In Flutter

0

Guess if you have opened any App and it shows a blank page. You will be having no clue what that application is doing. Even though the app might be doing some tasks in the background. Won’t it will affect the user experience? It will and users will end up having a bad opinion and review for the app.

To prevent this from happening flutter developers introduced a class named Linear Progress Indicator. It is one of the most used class while we have to make the user informed that the process which he initiated is being executed by the application and they need to wait for it to finish. It also helps in keeping the user aware of the progress that the task has made.

In this blog, I’ll be taking you through the overview, usage, and implementation of the class Linear Progress Indicator.


Table Of Contents:

What is Linear Progress Indicator?

Types

Constructor

Properties

Code implementation

Code Files

Conclusion


What is Linear Progress Indicator?

Linear Progress Indicator is predefined in the flutter using which we can make the user aware that some task is being executed by the application and once it finishes they will have the output or result. It can also be used for loading time so that users don’t have to see the blank screen.


Types:

  1. Indeterminate: Indeterminate progress indicator just used to show that app is running and performing some tasks. However, init a user won’t be having any clue when that background process will finish. For creating an indeterminate progress bar we set the value property null.
  2. Determinate: It is a type of indicator some set time has been calculated for the execution of tasks. It also indicates how much progress is completed. The value in the determinate progress indicator range from 0 to 1 where 0 indicates that progress is just started and 1 indicates that the progress is completed.

Constructor:

We need to use the below constructor to use the ClipOval widget in our code.

const LinearProgressIndicator({
Key? key,
double? value,
Color? backgroundColor,
Color? color,
Animation<Color?>? valueColor,
this.minHeight,
String? semanticsLabel,
String? semanticsValue,
}) : assert(minHeight == null || minHeight > 0),
super(
key: key,
value: value,
backgroundColor: backgroundColor,
color: color,
valueColor: valueColor,
semanticsLabel: semanticsLabel,
semanticsValue: semanticsValue,
);

Properties:

> value: It is the property that helps in differentiating between determinate and indeterminate progress indicators. If the value is set to null then the indicator will be indeterminate. However, if some value has been passed then it will work as a determinate progress indicator.

> backgroundColor: This property is used to set the background color of the progress loader.

> minHeight: It is the minimum height of the line that is used to draw the indicator in a LinearProgressIndicator or other words it is used to define how thick the line of an indicator looks.

> valueColor: It is used to define the progress indicator’s value as an animated value. This property covers the highlights of the completed task valued.

> AlwaysStoppedAnimation: It is used to specify a constant color in the valueColor property.

> Semantic Label: Used to add a semantic label.

> Semantic Value: Used to add Semantic value.

Code Implementation:

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

After which we will create a class inside the main.dart file.First, we will try to implement the Indeterminate progress indicator.

In the following code, we have created a class ProgressIndicator and used LinearProgressIndicator without passing any value.

class MyApp extends StatelessWidget { @override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Linear Progression Indicator',
debugShowCheckedModeBanner: false,
home: ProgressionIndicator(),
);
}
}
class ProgressionIndicator extends StatefulWidget {
const ProgressionIndicator({Key? key}) : super(key: key); @override
_ProgressionIndicatorState createState() => _ProgressionIndicatorState();
}class _ProgressionIndicatorState extends State<ProgressionIndicator> {
@override
Widget build(BuildContext context) {
return Scaffold( appBar: AppBar( backgroundColor: Colors.red, title:Text( "Flutter Devs"), ),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Linear Progression Indicator',style: TextStyle(color: Colors.black,fontSize: 20),),
Padding(
padding: const EdgeInsets.all(20.0),
child: LinearProgressIndicator(
backgroundColor: Colors.orangeAccent,
valueColor: AlwaysStoppedAnimation(Colors.blue),
minHeight: 25,
),
), ],
),
);
}
}

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

Now we will try to implement the determinate example in our code. For the same, we will use the Timer. period constructor. It creates a reoccurring callback function until we use the cancel function or it meets certain conditions.

So now we will initialize a variable with a value of zero.double value= 0;

Now we will create a function and increase the value variable by 0.1 every second. Also simultaneously we will update the state of the UI every time the function in revoked.

void determinateIndicator(){
new Timer.periodic(
Duration(seconds: 1),
(Timer timer){
setState(() {
if(value == 1) {
timer.cancel();
}
else {
value = value + 0.1;
}
});
}
);
}

Now we will pass this function on the tap of an elevated button.

Container(
margin: EdgeInsets.all(20),
child: ElevatedButton(
child: Text("Start"),
style: ElevatedButton.styleFrom(
onPrimary: Colors.white,
primary: Colors.blueGrey
),
onPressed: ()
{
value = 0;
determinateIndicator();
setState(() { });
},
),
)

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

Here we can see that our progress bar indicator is reflecting the progress. It turns red little by little indicating the progress of the function we defined. We can customize the animation and also show the percentage of how in written too. We can make the changes as per our requirement.

Code Files:

import 'dart:async';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: 'Linear Progression Indicator',
debugShowCheckedModeBanner: false,
home: ProgressionIndicator(),
);
}
}
class ProgressionIndicator extends StatefulWidget {
const ProgressionIndicator({Key? key}) : super(key: key); @override
_ProgressionIndicatorState createState() => _ProgressionIndicatorState();
}class _ProgressionIndicatorState extends State<ProgressionIndicator> {
double value = 0; @override
Widget build(BuildContext context) {
return Scaffold( appBar: AppBar( backgroundColor: Colors.red, title:Text( "Flutter Devs"), ),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Indeterminate Indicator',style: TextStyle(color: Colors.black,fontSize: 20,fontWeight: FontWeight.w500),),
Padding(
padding: const EdgeInsets.all(20.0),
child: LinearProgressIndicator(
backgroundColor: Colors.orangeAccent,
valueColor: AlwaysStoppedAnimation(Colors.blue),
minHeight: 25,
),
),
SizedBox(height: 20,),
Text("Determinate Indicator",style: TextStyle(color: Colors.black,fontSize: 20,fontWeight: FontWeight.w500),),
Container(
margin: EdgeInsets.all(20),
child: LinearProgressIndicator(
backgroundColor: Colors.lightBlueAccent,
color: Colors.red, minHeight: 15,
value: value,
),
),
Container(
margin: EdgeInsets.all(20),
child: ElevatedButton(
child: Text("Start"),
style: ElevatedButton.styleFrom(
onPrimary: Colors.white,
primary: Colors.blueGrey
),
onPressed: ()
{
value = 0;
determinateIndicator();
setState(() { });
},
),
)

],
),
);
}
void determinateIndicator(){
new Timer.periodic(
Duration(seconds: 1),
(Timer timer){
setState(() {
if(value == 1) {
timer.cancel();
}
else {
value = value + 0.1;
}
});
}
);
}}

Conclusion:

In the end, LinearProgressIndicator is a very useful tool in enhancing the user experience. It aids the user to understand and keep their expectations fulfilled. It is widely used to indicate the download percentage, uploading status, queue time, and many more.

It is very easy to use it and we can do numerous things using it. We can make it adapt to our code as per our requirements. It was just a small overview of the Linear Progress Indicator class its functionality and implementation. I hope the time you spent reading this article turns out to be productive. You can try implementing and modifying this code as per your needs.

Feel free to reach out to me for any suggestions or corrections where I can improve.

❤ ❤ 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.


A/B Testing In Flutter

0

A/B testing (also known as split testing or bucket testing) is a method of comparing two versions of a webpage or app against each other to find out which one performs better. A/B testing is essentially an analysis where two or more alterations of a page are shown to users at random, and statistical analysis is used to determine which alterations perform better for a given conversion goal.

Powered by Google Optimize, Firebase A/B Testing helps you optimize your app experience by making it easy to run, explore, and scale product and marketing experiments.… A/B Testing works with FCM so you can test different marketing messages, and with Remote Config so you can test changes within your app.


Table Of Contents:

Benefits of A/B Testing

When to use A/B Testing

How to Do A/B Testing

Why you should A/B Testing

Firebase Remote Config

Implementation

Conclusion

GitHub Link


Benefits of A/B Testing:

There are many benefits of A/B testing, just like we can easily compare two apps and many more:

  • Improved content: Testing ad copy, for example, requires a list of potential improvements to show users’ data. The very process of creating, considering, and evaluating these lists winnows out ineffective language and makes the versions better for users.
  • Increased conversion rates: A/B testing is the simplest and most effective means to govern the best content to convert visits into sign-ups and purchases. Knowing what works and what doesn’t helps turn more leads.
  • Fast Results: Even a moderately small sample size in an A/B test can provide serious, practical results as to which changes are most engaging for users. This allows for short-order development of new sites, new apps, and low-converting pages.
  • Lower risks: By A/B testing, devotion to costly, time-intensive changes that are proven ineffective can be avoided. A major conclusion can be well-informed, circumvent mistakes that could otherwise tie up resources for base or negative gain.
  • Improved user engagement: Part of a page, app, or email that can be A/B tested to contain the headline or subject line, imagery, forms and language, layout, fonts, and colors, etc. Testing one replaces at a time will show which pretentious users’ behavior and which did not. Updating the exploit with the “victorious” changes will improve the user experience in collection, eventually optimizing it for success.

When to use A/B testing:

There are three key goals for running A/B tests:

  • Deployment: When something is deployed on the app it could be for a new characteristic, and modernize, or several other causes. This is usually brought out by the engineering team. These deployments may be brought as a trial to test if it has no negative impact on the company’s KPIs.
  • Optimization: Also mention as lean formation which is mostly done by marketing. After you must have done your exploration to find out which test has more collision, you’re now ready to optimize while you look out for wins.
  • Research: This is fundamentally using A/B-testing for research before you amend which could be in the form of a flit, appear, or change signal on your website, app, or even campaign. For example, you want to see if adding some factor on your product page will condition conversion, so you make two differences of your product page, and then you run your A/B test to see if there will be a negative or positive result and pick which one to advance based on the results.

How to Do A/B Testing:

If it’s your first time with A/B Testing don’t panic, it’s completely simple. When you choose your tool, think of something that you would like to test, like a title in the stores, a disparate app view design, a button.

This is the cycle you should follow when planning your A/B testing strategy:

  1. Brainstorm to define a theory to see what needs to be tested.
  2. Variants: Select the component that is going to be tested.
  3. Test: Split the viewers and show them the two differences of the page.
  4. Analyze the results to decide which difference performed better.
  5. Apply the victorious variant.
  6. Keep testing. There’s always room for advancement and continuous tests will help you grow.

Why you should A/B Testing:

A/B testing allows entities, groups, and companies to make careful changes to their user experiences while gathering data on the results. This allows them to build theory and to learn why certain components of their experiences impact user behavior. In another way, they can be proven wrong — their belief about the best experience for a given aim can be proven wrong through an A/B test. More than just answering a one-off question or settling a dissent, A/B testing can be used to frequently improve a given experience or improve a single aim like conversion rate over time.

Testing one replaces at a time helps them pinpoint which changes had an outcome on visitor behavior, and which ones did not. Over time, they can unite the effect of multiple victorious changes from experiments to display the quantifiable upgrade of a new experience over the old one.


Firebase Remote Config:

Firebase Remote Config is a cloud service that lets you change the behavior and aspect of your app without needing users to download an app update. When using Remote Config, you create in-app default values that supervise the behavior and aspect of your app. Then, you can later use the Firebase console or the Remote Config backend APIs to override in-app default values for all app users or a bit of your user. Your app controls when updates are applied, and it can regularly check for updates and apply them with a trifling impact on performance.


Setting up Remote Config and AB testing:

The big snag with the Firebase Remote Config in its raw form is that it isn’t very easy to test on a single device. There are hardly any ways you can do this:

  1. You can jurisdiction your property using a Google Analytics spectator, but this takes hours if not days to modernize
  2. You can use a user property, this is the gel I am using
  3. You can get the device references and use this with an AB test. This is successful but, it requires a device identifier which can be firm to get unless you are already using Cloud Messaging

Implementation:

First, we create a flutter project, which name is ab_testing_demo. and then we start work on the firebase console, here we create a project and do the set up on the android studio(paste google.json file at android/app/(path) after that add the dependencies at build. Gradle file).

In the Firebase console, we go to the remote config and add the parameters for the project.

and add the parameter here:

After adding the parameter. Start coding in Android Studio, First, we need to add firebase_core and firebase_remote_config dependencies in pubspec.ymal file.

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^1.0.2
firebase_core: ^1.10.6
firebase_remote_config: ^1.0.3

In the main. dart file, we need to take the advantage of the remote configuration. The void main is a type of asynchronous after that we initialize firebase, in-home we specify FutureBuilder<> of type remote configuration and in it, we specify future and builder.

void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
title: "A/B Testing",
home: FutureBuilder<RemoteConfig>(
future: setupRemoteConfig(),
builder: (BuildContext context, AsyncSnapshot<RemoteConfig> snapshot) {
return snapshot.hasData
? Home(remoteConfig: snapshot.requireData)
: Container(
child: Text("No data available"),
);
},
),
));

In builder, we pass BuildContext and an asynchronous snapshot of type remote configuration and now you need to return snapshot has data and create a home. dart file and define a class Home() and pass remote config in-home(). In the future we pass setupRemoteConfig().

Create a method setupRemoteConfig() in the future, and make this method asynchronous function and add future(type of remote config), In this, we specify the final remote configuration. After that, we fetch the information by using remoteConfig.fetch() and activate the data and return remoteConfig().

Future<RemoteConfig> setupRemoteConfig() async { final RemoteConfig remoteConfig = RemoteConfig.instance; await remoteConfig.fetch();
await remoteConfig.activate();
return remoteConfig;
}

In-home. dart, add a constructor and create a final variable which is remote configuration, we can make use of this particular data. After this, we return Scaffold and add the appbar and use the property of the title and in scaffold pass body. In the body, we pass column() in the children of column() we pass Image.network we pass remoteConfig.get String(key) which is defined in firebase console we pass Image as key in it. and add the text and pass remoteConfig.getString(“key”) we pass text as key. we can also create a text in which we specify remoteConfig.lastFetchStatus.toString() in which we check the status of remoteConfig and we also create a text remoteConfig.lastFetchTime.toString() in which we check the time when we fetch the data and for this, we create a button in which we pass remoteConfig.setConfigSettings at onPressed() and add an icon of a refresh.

Scaffold(
appBar: AppBar(
title: Text('A/B Testing and REmote Config'),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
SizedBox(
height: 150.0,
),
Image.network(remoteConfig.getString("Image")),
SizedBox(
height: 50.0,
),
Text(
remoteConfig.getString("Text"),
style: TextStyle(fontSize: 20.0),
),
SizedBox(
height: 20.0,
),
Text(remoteConfig.lastFetchStatus.toString(),
style: TextStyle(
fontSize: 17
),),
SizedBox(
height: 20.0,
),
Text(remoteConfig.lastFetchTime.toString(),
style: TextStyle(
fontSize: 20
),),
SizedBox(
height: 20.0,
),
FloatingActionButton(
onPressed: () async {
try {
await remoteConfig.setConfigSettings(
RemoteConfigSettings(
fetchTimeout: Duration(seconds: 10),
minimumFetchInterval: Duration.zero) );
await remoteConfig.fetchAndActivate();
}
catch (e) {
print(e.toString());
}
},
child: const Icon(Icons.refresh),
)
],
),
),
),
);

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


Conclusion

In this article, we have been through What is A/B Testing In Flutter along with how to implement it in a Flutter. You can use the package according to your requirement.

❤ ❤ 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.


GitHub Link:

find the source code of the Positioned Transition Widget:

GitHub — flutter-devs/flutter_ab_testing_demo
A new Flutter project. This project is a starting point for a Flutter application. A few resources to get you started…github.com


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.


Convex Bottom Bar In Flutter

0

The convex Bottom bar is an app bar sketch in such a way that there is a convex shape to it. It can make the UI look great and also refine the way a user interacts with the Interface. In this article, we will build a simple app with one of the simplest forms of Convex bottom bar In Flutter


Table Of Contents:

Introduction

Add Dependency

How to Use

Features

Properties

Implementation

Conclusion

GitHub Link


Introduction:

Hello everyone, today we are discussing a very important topic of flutter UI which is the bottom navigation bar. In this article, we learn about Convex Bottom Bar. Convex Bottom Bar is a package of flutter. The convex Bottom bar is an app bar sketch in such a way that there is a convex shape to it. It can make the UI look great and also refine the way a user interacts with the Interface. In this article, we will build a simple app with one of the simplest forms of Convex bottom bar.

Providing a list TabItems widgets you can explain the icons and their title shown in the appbar. The list should contain only an odd number of TabItems to run the widget without fallacy causing. If you want to show images alternatively of icons you can provide images for the icon variable in each TabItem widget. If you want to generate a single Icon bottom appbar you can use the ConvexButton.fab widget. It produces you with fewer parameters and a quick and nice-looking one-icon-appbar.


Add Dependency:

In your project go to the pubspec. yaml and add the dependencies under the dependencies: add the latest version of convex_bottom_bar.

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
convex_bottom_bar: ^3.0.0

we use convax_bottom_bar for a better bootom_bar UI.


How to Use:

Generally, ConvexAppBar can work with scaffold by setup its bottomNavigationBar.The convexAppBar has two constructors, the convexAppBar() will use the levant style to simplify the tab creation. Add this to your package’s pubspec.yaml file, use the latest version.

Scaffold(
body: bottomNavigationBar: ConvexAppBar();
);

Features:

  • Provide various internal styles.
  • capability to change the theme of AppBar.
  • Provide builder API to modify a new style.
  • include the badge on the tab menu.
  • graceful transition animation.
  • Provide hook API to override some of the interior styles.
  • RTL reinforce.

Properties:

There are some properties of Convex_Bottom_Bar are:

  • fixed (subhead icon stays in the center)
  • fixedCircle (same but with a white circle on all sides the fixed icon)
  • react (superscripted icon replace on tapping another icon)
  • reactCircle (same but with a white circle throughout the superscripted icon)
  • textIn (the selected Ion appear his corresponding title)
  • titled (the non-selected icons are single showing their title)
  • flip (the tapped icon shows a flip animation)
  • custom (to customize premeditated parameters using the ConvexBottomAppBar builder)
  • height (grabbing the appbar)
  • top (grabbing the superscripted icon)
  • curveSize (stretching the curve of the superscripted icon)
  • color (setting the color of the icon)
  • backgroundColor (setting the appbar background color)
  • gradient (setting the appbar background color using a gradient widget)
  • activeColor (setting the circle color)

Implementation:

In the Convex_Bottom_Bar demo, First, we create a stateful class with the name MyHomePage() in this class we create a variable selectedpage type of integer pass with the value zero. and define a list with the name _pageNo, in which we pass all the pages which we want to add in bootom_navigation_bar.

int selectedpage =0;
final _pageNo = [Home() , Favorite() , CartPage() , ProfilePage()];

In BuildContext(), we define Scaffold. In the appbar, we define the name and center tile.

appBar: AppBar(
centerTitle: true,
title: Text('Convex Bottom Bar'),
),

After that in the body first, we pass the _pageNo with the value of selectedPage. and use the property of scaffold we use bottomNavigationBar. In this, we create ConvexAppBar() and pass Items, initialActiveIndex and onTap. in Items, we pass all the screens which we want to show in our application. And in initialActiveIndexwe pass the variable selectedpage which we already define and in onTap we pass index and define setState() in the setState we pass selectedpage equal to index.

bottomNavigationBar: ConvexAppBar(
items: [
TabItem(icon: Icons.home, title: 'Home'),
TabItem(icon: Icons.favorite, title: 'Favorite'),
TabItem(icon: Icons.shopping_cart, title: 'Cart'),
TabItem(icon: Icons.person, title: 'Profile'),
],
initialActiveIndex: selectedpage,
onTap: (int index){
setState(() {
selectedpage = index;
});
},
),

For index we create different pages, Home(), Favorite(), CartPage(), ProfilePage(). In the Home class we define a text with a background color.

Home Screen:

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

class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);

@override
_HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text('Home Page',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold
),),
),
);
}
}

Favorite Screen:

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

class Favorite extends StatefulWidget {
const Favorite({Key? key}) : super(key: key);

@override
_FavoriteState createState() => _FavoriteState();
}

class _FavoriteState extends State<Favorite> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.greenAccent,
body: Center(
child: Text('Favorite Page',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold
),
)),
);
}
}

CartPage Screen:

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

class CartPage extends StatefulWidget {
const CartPage({Key? key}) : super(key: key);

@override
_CartPageState createState() => _CartPageState();
}

class _CartPageState extends State<CartPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.pink.shade100,
body: Center(
child: Text('Cart Page',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold
),)),
);
}
}

ProfilePage Screen:

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

class ProfilePage extends StatefulWidget {
const ProfilePage({Key? key}) : super(key: key);

@override
_ProfilePageState createState() => _ProfilePageState();
}

class _ProfilePageState extends State<ProfilePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.yellow,
body: Center(
child: Text('Profile Page',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold
),)),
); }
}

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


Conclusion:

In this article, we have been through What is Convex Bottom Bar along with how to implement it in a Flutter. You can use the package according to your requirement.

❤ ❤ 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.

GitHub Link:

Find the source codeof the Convex Bottom Bar:

GitHub – flutter-devs/convex_bottom_bar_demo
A new Flutter project. This project is a starting point for a Flutter application. A few resources to get you started…github.com


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.


Explore Merging Two Maps In Dart

0

In this article, we will Explore Merging Two Maps In Dart. We perceive how to execute a demo program. We will show you how to couple of different approaches to merging two given maps in Dart in your applications.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

Introduction

Spread Operator Method

addAll() Method

putIfAbsent() Method

Conclusion


Introduction:

There may be occasions while working with Dart and Flutter when you need to combine two maps, The following points are:

  • > It could be desirable to merge two maps that have distinct characteristics for the same object. For example, you might have two maps: one with the user’s address, preferences, and history, and another with their name, phone number, and email address. These two can be joined to make a single map with all the user’s information on it.
  • Two maps that show separate data sources, like a local cache and a remote server, might be combined.
  • > It can be desirable to combine two maps — for example, a default configuration and a user-defined configuration — that have various app configurations or settings.

Spread Operator Method:

This approach utilizes the spread operator (…) to merge two maps into another map. The spread operator permits you to grow the components of an iterable for this situation, the key-value pairs of the maps into another new collection.

import 'package:flutter/foundation.dart' show kDebugMode;
void main() { 
Map<String, int> map1 = {'a': 10, 'b': 20};
 Map<String, int> map2 = {'c': 30, 'd': 40, 'FlutterDevs.com': 50};

 Map<String, int> mergedMap = {...map1, ...map2};
 if (kDebugMode) { print(mergedMap);
 }
 }

One thing you should be aware of is that the value in the second map will overwrite the value in the first map if there are duplicate keys in the maps that are being merged.

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

{a: 10, b: 20, c: 30, d: 40, FlutterDevs.com: 50} 
 Process finished with exit code 0

addAll() Method:

This arrangement utilizes the addAll() technique to merge two maps. The addAll() strategy adds all the key-value pairs starting with one map and then onto the next map.

import 'package:flutter/foundation.dart' show kDebugMode;
 void main() { 
Map<String, int> map1 = {'a': 10, 'b': 20};
 Map<String, int> map2 = {'c': 30, 'd': 40, 'FlutterDevs.com': 50}; map1.addAll(map2);
 if (kDebugMode) { print(map1);
 }
 }

By adding each key-value pair from the second map, this method directly changes the first map. The value in the second map will overwrite the value in the first one if duplicate keys are present, just like in the previous solution.

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

{a: 10, b: 20, c: 30, d: 40, FlutterDevs.com: 50} 
Process finished with exit code 0

putIfAbsent() Method:

If the key is not already in the second map, the putIfAbsent() method adds the key-value pair from one map to another.

import 'package:flutter/foundation.dart' show kDebugMode; 

void main() { 

Map<String, int> map1 = {'a': 10, 'b': 20, 'c': 27};

Map<String, int> map2 = {'c': 30, 'd': 40, 'FlutterDevs.com': 50};

map1.forEach((key, value) { map2.putIfAbsent(key, () => value); 

});

if (kDebugMode) { print(map2);

}

}

More control over handling duplicate keys is offeredTwo by this solution. You can choose whether or not the value from the first map should replace the value in the second map by using the putIfAbsent() method. It does, however, necessitate repeating the initial map’s key-value pairings, which could affect performance for big maps.

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

{c: 30, d: 40, FlutterDevs.com: 50, a: 10, b: 20}
 Process finished with exit code 0

Conclusion:

In the article, I have explained the Merging Two Maps InDart; you can modify this code according to your choice. This was a small introduction to Merging Two Maps In Dart User Interaction from my side, and it’s working using Flutter.

I hope this blog will provide you with sufficient information on Trying the Merging Two Maps In Dart of your projects. We’ve covered a few methods for combining several maps into one. While selecting the best solution, take into account the details of your use case, the size of the maps, and the potential for duplicate keys. 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! For any flutter-related queries, you can connect with us on FacebookGitHubTwitter, and LinkedIn.

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: Moving Marker Using Polyline On Google Maps In Flutter

Related: Sorting List of Objects/Maps By Date In Flutter

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


Post image

Cupertino Sliver Navigation Bar In Flutter

0

Have you ever thought of implementing ios styled large tiles in your flutter application? Flutter provides a widget to help you in the same-named CupertinoSilver NavigationBar. It is widely used by developers across the community.

CupertinoSilver NavigationBar widgets were designed to aid the developers to implement ios themed features in the flutter apps that are built for the ios platform. Since its introduction, it has gained a lot of appreciation across the community.

In this blog, I’ll be taking you through the overview, usage, and implementation of the class Cupertino Sliver Navigation Bar.


Table Of Contents:

What is CupertinoSilver NavigationBar?

Constructor

Properties

Code implementation

Code Files

Conclusion


What is CupertinoSliverNavigationBar?

The CupertinoSliverNavigationBar is placed in a sliver group such as the CustomScrollView.Cupertino sliver navigation bar has two sections where one section is fixed at the top. The second one is a sliding section with a large title. The second section will appear below the first.

It will slide down to show the large title when the sliver expands. It will hide under the first section if the sliver collapses. Like CupertinoNavigationBar, it also supports a leading and trailing widget on the static section on top that remains while scrolling.

Constructor:

We need to use the below constructor to use the CupertinoNavigationBar widget in our code.

CupertinoSliverNavigationBar(
{Key? key,
Widget? largeTitle,
Widget? leading,
bool automaticallyImplyLeading,
bool automaticallyImplyTitle,
String? previousPageTitle,
Widget? middle,
Widget? trailing,
Border? border,
Color? backgroundColor,
Brightness? brightness,
EdgeInsetsDirectional? padding,
bool transitionBetweenRoutes,
Object heroTag,
bool stretch}
)

Properties:

> largeTitle: This text will appear in the top static navigation bar when collapsed and below the navigation bar, in a larger font, when expanded.

> automaticallyImplyLeading: Controls whether we should try to imply the leading widget if null.

> leading: Widget to place at the start of the navigation bar. It takes a widget as value.

> heroTag: Defaults to a common tag between all CupertinoNavigationBar and CupertinoSliverNavigationBar instances of the same Navigator. With the default tag, all navigation bars of the same navigator can transition between each other as long as there’s only one navigation bar per route.

> automaticallyImplyLeading: Setting this property to true will automatically display a leading widget according to the scenario. It takes boolean as value.

> previousPageTitle: It is used to specify the previous page route’s title. When the leading is null and automaticallyImplyLeading is true the sliver navigation bar will use this title as leading. It takes a string as a value.

Code Implementation:

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

After this, we will create a Stateless Widget that will return Material App. Inside of this, we will pass out class MyHomePage.

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.pink,
),
home: const MyHomePage(),
);
}
}

Now before using Cupertino properties we will import the Cupertino package in our main.dart file.

After this, we will return CupertinoPageScaffold under our MyHomePage class.

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
bool state = false;

@override
Widget build(BuildContext context) {
return CupertinoPageScaffold()

Inside CupertinoPageScaffold we will pass CustomScrollView as a child. After this, we will pass CupertinoSliverNavigationBar.

CustomScrollView(
slivers: [
CupertinoSliverNavigationBar(
backgroundColor: Colors.black,
leading: CupertinoNavigationBarBackButton(
onPressed: () {},
color: CupertinoColors.activeBlue,
),
middle: Text(
"Cupertino Sliver Navigation Bar",
style: TextStyle(color: Colors.white),
),
trailing: CupertinoButton(
padding: EdgeInsets.zero,
child: Text(
"Done",
style: TextStyle(
color: CupertinoColors.activeBlue,
),
),
onPressed: () {},
),
largeTitle: Padding(
padding: const EdgeInsets.only(left: 20),
child: Text("Large Tile", style: TextStyle(
color: CupertinoColors.white,
),),
),
previousPageTitle: "Back",
),

)

],
),

In the above code, we have used the CupertinoSilverNavigationBar properties such as leading, middle, trailing, largeTitle.

After this, we will pass SilverGrid in the main body of the page.

SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.0,
crossAxisSpacing: 10.0,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Padding(
padding: const EdgeInsets.only(left: 10,right: 10),
child: Container(
color: CupertinoColors.systemGrey3,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network("https://media.wired.com/photos/593261cab8eb31692072f129/master/pass/85120553.jpg",fit: BoxFit.fill,),
)
),
),
childCount: 10
)
)

I have passed the image inside the container which is up to you what you want to choose.

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

Code Files:

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

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

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.pink,
),
home: const MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
bool state = false;

@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
backgroundColor: Colors.white,
child: CustomScrollView(
slivers: [
CupertinoSliverNavigationBar(
backgroundColor: Colors.black,
leading: CupertinoNavigationBarBackButton(
onPressed: () {},
color: CupertinoColors.activeBlue,
),
middle: Text(
"Cupertino Sliver Navigation Bar",
style: TextStyle(color: Colors.white),
),
trailing: CupertinoButton(
padding: EdgeInsets.zero,
child: Text(
"Done",
style: TextStyle(
color: CupertinoColors.activeBlue,
),
),
onPressed: () {},
),
largeTitle: Padding(
padding: const EdgeInsets.only(left: 20),
child: Text("Large Tile", style: TextStyle(
color: CupertinoColors.white,
),),
),
previousPageTitle: "Back",
),
SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.0,
crossAxisSpacing: 10.0,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => Padding(
padding: const EdgeInsets.only(left: 10,right: 10),
child: Container(
color: CupertinoColors.systemGrey3,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network("https://media.wired.com/photos/593261cab8eb31692072f129/master/pass/85120553.jpg",fit: BoxFit.fill,),
)
),
),
childCount: 10
)
)
],
),
);
}
}

Conclusion:

In the end, CupertinoSilverNavigationBar is a very useful tool in enhancing the user experience. It aids the user to understand and keep their expectations fulfilled. It is widely used to give application ios styled themes and user interface.

It is very easy to use it and we can do numerous things using it. We can make it adapt to our code as per our requirements. It was just a small overview of the CupertinoSilverNavigationBar class its functionality and implementation. I hope the time you spent reading this article turns out to be productive. You can try implementing and modifying this code as per your needs.

Feel free to reach out to me for any suggestions or corrections where I can improve.

❤ ❤ 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: Flutter Deep Links – A unique way!

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


Cupertino Switch in Flutter

0

When ios introduced switch-type buttons it became intensively popular among users as well as developers. Developers always want to implement such buttons in their applications irrespective of the platform be it ios or android.

Flutter provides an option to implement it in the form of a widget Cupertino switch. Using the Cupertino switch widget developers can easily implement use the ios styled switches in your application regardless of the platform.

In this blog, I’ll be taking you through the overview, usage, and implementation of the widget CupertinoSwitch.


Table Of Contents:

What is CupertinoSwitch ?

Constructor

Properties

Code implementation

Code Files

Conclusion


What is CupertinoSwitch?

Cupertino switch is an ios styled switch that works like any normal switch in your home. The switch will have a certain condition which once fulfilled will turn the switch on and if not then off.

Whenever there is a change in the state of the switch the onChanged callback will invoke. It will return the updated state which is true or false. So based on the value returned by the callback we have to update the UI and perform some action. It is generally used in the setting sections of an app like wifi, Bluetooth, and many more using the switch in settings of the mobile device.

Constructor:

We need to use the below constructor to use the CupertinoNavigationBar widget in our code.

CupertinoSwitch(
{Key? key,
required bool value,
required ValueChanged<bool>? onChanged,
Color? activeColor,
Color? trackColor,
Color? thumbColor,
DragStartBehavior dragStartBehavior}
)

Properties:

> value: It takes the boolean value as input. The value decides the on/off condition of the switch.

> onChanged: It takes a callback function as a value. This function will invoke every time the user turns the switch on/off. To update the UI with the latest position we have to call setSatete() inside the onChanged function.

> activeColor: The color of the switch when it is in an active state. The default color is green.

> trackColor: It is the color when the state of the switch is off.

> dragStartBehavior: Determines the way that drag start behavior is handled.

> thumbColor: The color to use for the thumb of the switch.

Code Implementation:

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

After this, we will create a Stateless Widget that will return the Material App. Inside of this, we will pass out class MyHomePage.

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

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

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

Now before using Cupertino Switch we will import the Cupertino package in our main.dart file.

After this, we will return CupertinoPageScaffold under our MyHomePage class.

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

class _MyHomePageState extends State<MyHomePage> {
bool state = false;
@override
Widget build(BuildContext context) {
return new CupertinoPageScaffold()

Inside it, we will be passing our CupertinoSwitch along with other properties of CupertinoSwitch like thumbColor, activeColor. Also, we will be changing the state under onChanged property.

CupertinoSwitch(
value:state,
onChanged: (value){
state = value;
setState(() {

},
);
}, thumbColor: CupertinoColors.destructiveRed,
activeColor: CupertinoColors.activeBlue,

),

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

The Text below has also been assigned state change. So when the onChange value is changed it corresponds to the same.

Code Files:

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

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

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'CupertinoSwitch',
theme: ThemeData(
),
home:MyHomePage(),
);
}
}

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

class _MyHomePageState extends State<MyHomePage> {
bool state = false;
@override
Widget build(BuildContext context) {
return new CupertinoPageScaffold(
backgroundColor: Colors.black,
navigationBar:CupertinoNavigationBar(
leading: CupertinoNavigationBarBackButton(
onPressed: ()
{ },
color: CupertinoColors.label,
),
middle: Text(" CupertinoSwitch")
),
child:Material(
child: Container(
margin: EdgeInsets.only(top:120, left: 50, right: 20),
width: double.infinity,
child:Column(
children: [
Container(
width: double.infinity,
child: Row(
children: [
SizedBox(
width: MediaQuery.of(context).size.width*0.5,
child: Text("Bluetooth", style: TextStyle(fontWeight: FontWeight.bold),),
),
SizedBox(
width: MediaQuery.of(context).size.width*0.20,
child: CupertinoSwitch(
value:state,
onChanged: (value){
state = value;
setState(() {

},
);
}, thumbColor: CupertinoColors.destructiveRed,
activeColor: CupertinoColors.activeBlue,

),
),
],
),
),
SizedBox(
height: 20,
),
Divider(
height: 1,
color: CupertinoColors.systemGrey5,
),
SizedBox(
height:40
),
Text(state == true? "Bluetooth turned on": "Bluetooth turned off",
style:TextStyle(
fontWeight: FontWeight.bold,
color: state == true? CupertinoColors.secondaryLabel : CupertinoColors.activeOrange
),
),
],
)
),
),
);
}
}

Conclusion:

In the end, CupertinoSwitch is a very useful widget in helping the developer for implementing ios styled switches in a very easy way. It is widely used to give application ios styled on/off switches.

It is very easy to use it and we can use it in numerous conditions. We can make it adapt to our code as per our requirements. It was just a small overview of the CupertinoSwitch widget its functionality and implementation. I hope the time you spent reading this article turns out to be productive. You can try implementing and modifying this code as per your needs.

Feel free to reach out to me for any suggestions or corrections where I can improve.

❤ ❤ 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.


Flutter 2.10 — What’s New In Flutter

0

For a few years, Google has been developing Flutter and aspires to create the cross-platform software framework of the developers’ vision. The all-new ​​​Flutter 2.10 is now available, and it covers some exciting new features!

Hello everyone finally here is Flutter 2.10 which is Flutter’s stable version. This version brings big updates to Flutter support for windows. Google has been developing Flutter to build cross-platform software for developers for the past decagon. 85% of developers must know how to hold Flutter, and now they are looking for the next updates.


Table Of Contents:

Windows is now ready for production apps

Web App Updates

Android Updates

IOS Updates

Flutter SDK

Performance Enhancements

Material 3

Enhancements to integration testing

Flutter Dev Tools

Conclusions


Windows is now ready for production apps:

In the Flutter 2.10 release, there is no longer a requirement to flip an interchange. Of course, it easily coalesces well with Windows support. The new version quickly generates the Windows app on Flutter stable channel

This version contains significant improvements to text handling, keyboard handling, keyboard shortcuts, and new integrations directly into Windows, including support for command-line arguments, globalized text entry, and accessibility.


Web App Updates:

This release also has many updates in web developments. For example in previous releases, scrolling to the extremity of a multi-line Text-field on the web did not work congruously.

Edge scrolling for text selection is instigated in this release: when the selection stirs outside of the text field, the field scrolls to show the scroll comprehensiveness. This new functionality is convenient in both web and desktop apps. In inclusion, this Flutter release includes another notable web refinement.


Android Updates:

The new release of Flutter 2.10 has refinement for Android users as well. If the developers fabricate a new app, the Flutter release automatically supports the new release 12. The Flutter 2.10 enables multiplex support with automatic release as well.
The flutter tool gives a high-end intent to those steps into slight support. It provides increased carry for the Android SDK genre with new logs. In a current report, 76% of Android users must know about the Flutter app development.


IOS Updates:

Inclusion to performance advance, we’ve also added some platform-specific features and improvements. One new improvement is smoother keyboard animations in iOS from luckysmg, which is bestowed automatically to your app without you having to do a thing.

In inclusion to this, the Flutter app development company will update Flutter for iOS users. They will update iOS using the new version of the Flutter 2.10 platform. Developers can get 64-bit iOS architecture to obtain unique features.


Flutter SDK:

Utilizing Flutter DevTools takes new steps to assess the features. In inclusion to this, it locates updated features. It utilizes the latest release and latest move to dart DevTools for suitable version options. Using Pub global actuate seems to be an essential part of development in 95% cutting border solutions.

On the other hand, the Flutter DevTools uses overturn as the flag and contemplates extensive advance. It will change towards keyboard shortcuts and maximize the sake. The combination works directly with Windows and braces command-line arguments.


Performance Enhancements:

There is undeviating region management. The new version is relevant on iOS and metal for fragmentary configuration. There is a swap in 90th and 99th percentile rasterization. The immensity of gauge and GPU integration is a must heed in the new release. It creates a magnificent benchmark and takes more than 90% of the developer’s first.

In profile and release manner, Dart code is compiled forward of time to native machine code. The clue to the organization and compact size of this code is a whole program type glide analysis that unlocks many compilers amendments and hostile tree-shaking. However, as the type flow inspection must cover the whole program, it can be somewhat expensive.


Material 3:

This version marks the start of the Material 3 transition, which encompasses generating an entire color strategy from a single seed color. You can generate an occasion of the new ColorScheme type with any color. This version also adds ThemeData. The use of Material 3 flag source components to adopt the new Material 3 appearance.

There are also 1,028 new Material icons.


Enhancements to integration testing:

The integration testing works successfully and depends on the Flutter SDK by definition. The integration testing is reasonable and gets into new attributes as well. It gives an impressive blend and considers the flutter driver package with an absolute solution.


Flutter Dev Tools:

employ Flutter DevTools takes a new pace to evaluate the features. In inclusion to this, it discovers updated traits. It utilizes the latest release and new move to dart DevTools for suitable version options. Using Pub global actuateseems to be an integral part of development in 95% cutting edge suspension.


Conclusion:

In this article, we have been through What is new in Flutter 2.10 version. You can learn new things through this article, apply them to your project and make your project fast and easy.


❤ ❤ 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.

Theme Switching with Bloc and RxDart In Flutter

0

Themes, are a topic people often talk about while making apps the most commonly used term regarding this topic would be ‘dark theme’, You can often see people asking how to manage a dark theme in your application or even going as far as asking how to manage different icons for different themes.

One such incident of managing themes happened to me when I was asked to manage 2 separate theme modes based on user preferences. So, I would like to share with everyone how I managed it at that time, hope everyone enjoys following along.



First things first let me brief you about this a little, In this, we will be managing 2 themes first one will be ‘red’ and the second one is called ‘blue’. On user selection the theme would completely change on every screen even icons and background images, So to further progress with this I suggest making 2 folders.

We are going to name the first folder as Red and the second one Blue respectively and put all our icons and background images inside of them.

Now we are done with the basic setup, it’s time to move on to the coding part of it. First of all, we will create an enum that will help us manage our themes

enum Mode { red, blue }

Alright, now we will work on our stream part for this. First of all, we will create a new file and call it theme_bloc_state.dart

part of 'theme_bloc_cubit.dart';

abstract class ThemeSwitchBloc {}

class ThemeInitial extends ThemeSwitchBloc {}

Secondly, we will create the theme_bloc_cubit.dart file

import 'dart:async';

import 'package:bloc/bloc.dart';

part 'theme_bloc_state.dart';

class ThemeBlocCubit extends Cubit<ThemeSwitchBloc> {
ThemeBlocCubit() : super(ThemeInitial());

final _themeController = BehaviorSubject<Mode>();

Stream<Mode> get themeStream => _themeController.stream;

dynamic switchTheme(Mode mode) async {
if (mode != Mode.red) {
_themeController.sink.add(mode);
return Mode.friendship;
} else {
_themeController.sink.add(mode);
return Mode.blue;
}
}

}

Note: You can learn more about behavior subjects over here

Moving onto, now we will be looking at switching the theme itself, but before that, we got to create a function that will return to us the current theme’s colors and the current theme’s icons path

So we will create 2 globally accessible functions inside our UiHelper class

Function 1 :

static Color getColor({
required Mode? themeMode,
}) {
var _color = Colors.red;
switch (themeMode) {
case Mode.blue:
_color = Colors.blue;
break;
case Mode.red:
_color = Colors.red;
break;
default:
break;
}
return _color;

}

This function will return to us the color for the theme, you can create even more functions that go into even more details as to what you may need

Function 2 :

static String getThemeIconPath({
required Mode? mode,
required String iconName,
}) {
var _iconPath = 'assets/red/';
if (mode != null) {
switch (mode) {
case Mode.blue:
_iconPath = 'assets/blue/';
break;
case Mode.red:
_iconPath = 'assets/red/';
break;

default:
break;
}
}
_iconPath = _iconPath + iconName;
return _iconPath;
}

The second function returns us the path for a particular icon. With this, we are now set to start with our changing of the theme. So, here is the shortcode for setting up a way to change the theme, I am using radio buttons for this :

var _radioSelected = Mode.red;StreamBuilder(
stream: _themeCubit?.themeStream,
builder: (context, snapshot) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Radio(
value: Mode.red,
groupValue: _radioSelected,
activeColor: Colors.blue,
onChanged: (dynamic value) async {
_changedOptions(value);
},
),
Text('Red'),
],
),
Row(
children: [
Radio(
value: Mode.blue,
groupValue: _radioSelected,
activeColor: Colors.blue,
onChanged: (dynamic value) async {
_changedOptions(value);
},
),
Text('Blue'),
],
),
Container(),
],
);
}),

The basic working is that when you click on the radio button, it will now update the value of our themeStream and similarly update the value of _radioSelected, which will allow new values to be returned in our getColor and getThemeIconPath functions.

The function to do so is:

void _changedOptions(value) async {
_radioSelected = _themeCubit?.switchTheme(value);
_radioSelected = value;
}

With this, we can finally change the theme whenever we want, now to look at the effect of theme changing we once again have to use a stream builder to read our from our stream :

StreamBuilder<Mode>(
stream: _themeCubit?.themeStream,
builder: (context, snapshot) {
return Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 20),
color: UIHelper.getColor(themeMode: snapshot.data),
child: Center(
child: Image.asset(UIHelper.getThemeIconPath(
mode: snapshot.data,
iconName: IconConstants.alarm),),
),
);
})

With this we can see the color changing, as every time we will switch the theme, it will return the new icon path and the new color, the default values are taken in the UiHelper function to make sure a value is always returned and we never encounter a null value.

This was but a simple example of how switching themes with rxDart and Bloc Cubit works if your objective was to change even the icons on the flip of a switch this method certainly works.

If you are facing any problems in the future implementing this, feel free to reach out to me, I would be happy to help.

I know this tutorial was a short one but it felt refreshing to come up with a way when someone asked me how do I change all the icons in an app with the flip of a button, I enjoyed implementing and writing about it, I hope everyone reading this also enjoys implementing it, If there are some better ways to achieve the same available please do let me know of those as well, I would love to look into them.


❤ ❤ 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: Validation Using Bloc In Flutter

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

Automation Testing In Flutter

0

Mobile phones and mobile applications — both are booming in this present reality. Having the force of a PC in your pocket is progressive. According to Statista, mobile accounts for the greater part of the web traffic around the world. Mobile phones (barring tablets) added to 54.4 percent of worldwide site traffic in the final quarter of 2021, expanding reliably over the recent years.

Source

As simple as it has been to record a mobile application’s advantages in the present web-driven world, it has not been that straightforward in creating one. Worldwide, mobile phones are driven by Android and iOS. Together they might run over close to 99% of the mobile phones yet their fundamental application development architecture is entirely different.

Flutter is a unique mobile application development toolkit (although it upholds desktop OS). The toolkit compartment has been an uncommon hit as it advances code once and runs on any stage. It cuts down development costs, maintenance costs, and testing costs with time extending to a lower level.

Developers evaluated it and acknowledged it with great affection. With the project count increasing, Flutter testing has turned into a critical and mindful work. This post on testing Flutter applications takes you around a similar theme exploring Flutter, its fundamentals, and Flutter testing in the most productive way.


Table Of Contents:

What is Flutter?

Why use flutter?

Why flutter testing is important?

How to test flutter Applications?

Flutter Testing Manually On Real Device Cloud

Flutter Testing Using FlutterDriver

Flutter Testing Using Automation On Real Device Cloud

Conclusion


What is Flutter?:

Flutter is an open-source framework created by Google to back out the course of mobile application development and work with the code reuse policy. Flutter runs on the standard of cross-program testing development. In this manner, a single code unit can be incorporated for different stages like Android, iOS, Linux, Windows, and macOS.

Flutter is by all an incredible fanatic of widget-based development. It gives reusable code components, for example, buttons and sliders for simple customizations as indicated by the project needs. The second mainstay of the Flutter structure is the SDK (Software Development Kit) which assembles the code as indicated by operating system like Android and iOS. Alongside these two unequivocal and strong qualities, every one of the connected highlights, for example, time-saving, and cost-cutting, come into the image.

Why use Flutter?:

I’m certain you more likely than not got a thought at this point about the advantages of involving Flutter as a development framework. To sum up, the framework offers the accompanying things of real value:

  • > Cross-platform application development framework.
  • > Brings out a fast application.
  • > Open-source platform and therefore tons of contributions from people who hear what you want to say.
  • > Flutter uses darts. If you are familiar with the language, it might become a de-facto choice for you.
  • > Flutter also comes with excellent IDE support. IntelliJ, Emacs, VSCode, and Android Studio all support Flutter development.
  • > The framework is often appraised for its exhaustive official documentation.
  • > It might have been just four and a half years since the release of Flutter, but it offers a very vast community.
  • > Flutter has topped the charts as the most used cross-platform software development framework. The strong growth shows a promising future, and if you are looking to learn something new, Flutter could be the best choice.

The above image shows the growth rate of cross-platform frameworks in three consecutive years.

Why Flutter Testing is Important:

For high-quality, scalable Flutter applications, testing is one vital basic region. Most teams and developers have a solid comprehension of the significance of testing yet frequently miss the mark on the experience of writing great tests, when to write, and where to write.

A good testing system guarantees that current assumptions and presumptions are met and increments trust in the product. With such countless products utilizing flutter, testing is significantly more vital to guarantee that the code we write now will in any case work appropriately regardless of the number of features we add or the number of developers we onboard to the project.

How to test Flutter applications:

At this point, we are persuaded that Flutter applications are not difficult to create, and with the advantages it offers, it is generally on the shortlist before beginning another project. Yet, is it a similar case with Flutter testing based on applications?

In Flutter testing, we have two methods:

  • > Manual testing for things such as UI, experience, widget compositions, and so forth.
  • > Automation testing for checking the usefulness of utilizing different sorts of data and activities on the applications. On the off chance that you are searching for a cloud-based solution, LambdaTest can fill the two needs in a single stage which is generally prescribed to work swiftly

Flutter Testing Manually On Real Device Cloud:

The Real device could be viewed as perhaps the most ideal decision for mobile application testing when contrasted with testing on emulators and test systems. It doesn’t cost as much as building another genuine device lab and gives us precise outcomes for the tests. Cloud-based applications have a variety of emulators for mobile applications yet as a tester, attempt to favor the real gadget cloud.

  • > Starting in Any application first we have to create test cases and evidence for the app.
  • > Then log in to the Traffic Sentinel App.
  • > Check home screen is available or not.
  • > Click on the Report offense icon then the report offense screen is visible.
  • > Check whether video and photo icons working or not.
  • > Clicking on send icon functionality working or not.
  • > Clicking on Reported offense, then In progress data should be visible.
  • > Check functionality of both IOS and Android.
  • > If both devices working fine. Confirm Developer for the same.

Flutter Testing Using FlutterDriver:

Flutter testing is genuinely simple to implement, particularly while utilizing the FlutterDriver expansion. FlutterDriver is an augmentation given by the flutter_driver package for integration testing Flutter applications on real devices and emulators.

By utilizing the Flutter Driver expansion, we can run tests written in Dart and obtain brings about a machine-readable format. Flutter Driver associates with an application and drives it like a user would, collaborating with the widgets within it. This permits us to test our applications completely, including edge cases that might be challenging to reach the hard way. You can write unit tests with flutter_test, widget_test, and integration tests with the Flutter Driver extension.

Flutter Driver is like Selenium WebDriver. Automating the Flutter UI and running it against real devices or emulators is utilized. The benefit of utilizing Flutter Driver is that we can automate our testing utilizing a particular stage like Android Studio or through the command line.

Flutter Testing Using Automation On Real Device Cloud:

Using Appium as the go-to automation is a good decision for testing tools for automation testers. The issue is only the device cloud that they need to have and keep up with in-house for such a long-distance race. Real device cloud supporting Appium can be an achievable decision that can wrap up your application test automation quicker than you can expect.

Automation gives an Appium Grid to mobile testing with real devices at their end. Along these lines, you can decrease your test execution time by 10x and coordinate CI/CD advances on a similar pipeline. Moreover, covering all tests in a single spot gives you to coordinate and keep up with test information and results for better examination. In Automation, we need to run data in an automated tool environment utilizing an emulator or test system.

Conclusion:

Flutter was released as a steady form in 2018. In such a brief time frame, this is how Flutter’s utilization diagram moved around the same year.

It is today one of the most involved systems for mobile application development, and according to my experience, simply two things trait to this achievement. First is the widget-based development, which is a huge hit as developers can handle their components. Furthermore, the capacity to write once and develop applications for Android and iOS together is a huge selling point in the software industry. You save on time and costs and simply keep one codebase. Furthermore, it is quick, light, and gives a rich UI to the application.

Today many companies use Flutter in their application advancement and delivery of the application to a large number of users. Be that as it may, your application venture doesn’t end here. No application is finished without testing and checking its usefulness before delivery. This guarantees great quality and great feedback from the user. The prescribed method to test your Flutter applications is utilizing a cloud-based solution with one or the other manual or remote methods.


❤ ❤ 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.