Google search engine
Home Blog Page 53

Dart DevTools

0

DevTools is a tooling suite for Flutter and Dart developers consisting of layout inspection tools, performance tools, memory tools & many other debugging tools that you need to be an efficient and effective Flutter developer, all bundled into a single web suite for you!

DevTools is a standalone suite of tools that run in the browser. They provide additional telemetry and functionality that aren’t practical to show in the IDE.

It has been rebuilt from scratch in Flutter! Let’s first take a moment to discuss why the Flutter team rebuilt DevTools in the first place. The short answer is productivity and quality. The Flutter team understands the productivity benefits of Flutter when building beautiful, high-performance UIs — and we want those benefits for ourselves. This productivity has not only to rebuild DevTools but also added big new features along the way!

What can I do with DevTools?

Here are some of things you can do with DevTools —

✅ Inspect the UI layout and state of a Flutter app.

✅ Diagnose UI jank performance issues in a Flutter app.

✅ CPU profiling for a Flutter or Dart app.

✅ Network profiling for a Flutter app.

✅ Source-level debugging of a Flutter or Dart app.

✅ Debug memory issues in a Flutter or Dart command-line app.

✅ View general log and diagnostics information


Overview of features

How to launch DevTools in your favorite editor ?

Flutter Inspector

Layout Inspector

Timeline View

Memory View

Performance View

Network View

Debugger

Summary


How to launch DevTools?

You can launch DevTools in VS Code, Android Studio, or even from Command Prompt.

VS Code

Step 1: Activate Debug session for your App

Step 2: Once the debug session is active and the application has started, the Dart: Open DevTools command becomes available in the VS Code command palette:

Step 3: The first time you run this (and subsequently when the DevTools package is updated), you are prompted to activate or upgrade DevTools.

Step 4: Click on open & it will launch the DevTools


Android Studio

Once an app is running, you can start DevTools using one of the following in Android Studio:

✔Select the Open DevTools toolbar action in the Run view.

✔Select the Open DevTools toolbar action in the Debug view. (if debugging)

✔Select the Open DevTools action from the More Actions menu in the Flutter Inspector view.


To install from Command Line

Install and run DevTools from the command line
Install DevToolsIf you have `pub` on your path, you can run:“`pub global activate devtools“`If you have `flutter` on…flutter.dev


Let us now look at some of the features of DevTools —

Flutter Inspector

It is a tool that can be used to inspect the UI layout and state of a Flutter app. The inspector helps you visualize and explore Flutter widget trees, and can be used for the following:

✔ understanding existing layouts

✔ diagnosing layout issues

Widget Hierarchy Flutter Inspector

Layout Explorer

Lifesaver Feature

The next lifesaver feature is the Layout Explorer . You’ll see the Layout Explorer tab next to Details Tree. Select this tab to display the Layout Explorer feature.

The Layout Explorer visualizes how Flex widgets and their children are laid out. The explorer shows layout constraint violations and render overflow errors. These visualizations aim to improve understanding of why overflow errors occur as well as how to fix them.

Layout Explorer

Using the Flutter inspector
Select widget mode Enable this button in order to select a widget on the device to inspect it. For more information…flutter.dev


Timeline View

Consider a case when due to a particular frame your app gets slower & you don’t know where to find that in your code. Timeline View becomes a lifesaver in such cases & is handy when you’re trying to find out which widgets, exactly, are behind a slow frame.

The Timeline view shows build times for each frame as well as a flame chart. This makes it easy to identify problematic frames while seeing them in context.

Frame Chart

You can see the problematic bar in red , selecting a bar from this chart centers the flame chart below on the timeline events corresponding to the selected Flutter frame. The events are highlighted with blue brackets.

Events

You can now view the event in your code which is making your app slower & modify your App’s code to make it faster !😍


Memory View

Memory pane lets you peek at how an isolate is using memory at a given moment. The Memory view lets you peek at how your app is using memory at a given moment. This view now shows a heatmap of the allocated memory, and allows tracking platform memory as well.

Memory View

Performance View

The performance view allows you to record and profile a session from your Dart or Flutter application. This can be used to decide where to spend optimization efforts!

Start recording a CPU profile by clicking Record. When you are done recording, click Stop. At this point, CPU profiling data is pulled from the VM and displayed in the profiler views (Call Tree, Bottom-Up, and Flame Chart).

Performance View

Network View

The network view allows you to inspect HTTP network traffic from your Dart or Flutter application.

HTTP traffic should be recorded by default when you open the Network page. If it is not, click the Record HTTP traffic button in the upper left to begin polling.

You can see the whole history of requests that your app made since it started and detailed information about each one. This frees you from having to log these events on your own when trying to debug a network issue.

Network View

Debugger

DevTools includes a full source-level debugger, supporting breakpoints, stepping, and variable inspection. This can be useful if you are not using an IDE for development but still want the option to add breakpoints, step through the code, peek at variable values, and so on.

Breakpoints

Summary

The rewrite of DevTools to Flutter has many benefits: increased productivity, walking in the shoes of our customers, and freedom of choice of target platforms.

Rebuilding DevTools in Flutter invites the community to contribute more easily. DevTools was always developed in the open, but today, most users will be familiar with its


Resources :

DevTools
Docs Development Tools DevTools DevTools DevTools is a suite of performance and debugging tools for Dart and Flutter…flutter.dev

flutter/devtools
This is a companion repo to the main Flutter repo. It contains the source code for a suite of performance tools for…github.com


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.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire 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: Metadata Annotations in Dart

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

How to search Firestore data in Flutter 2026

0

Introduction

In this blog, we shall discuss about the search feature using database and locally in our app. I will use both cloud firestore and realtime database to implement a search feature. This feature is a very common feature in production applications nowadays. It also enhances the app standard and make it more productive. It also saves the user time.


Table of contents:

:: Using cloud firestore

:: Using search Delegate

:: Github link


Importance of Search Feature in an app :

  • : It saves the time of the user to find any object/Item
  • : Provides transparency about the searched title
  • :: Improves the standard of the app
  • :: User-friendly, interactive, easy to use

Using cloud firestore

Here in this section, we will learn how to search for data on the cloud Firestore. First, we will create a collection of data on the cloud firestore, then we will use it to perform a search of items in our app.


Create a collection on cloud firestore

You can follow the instructions given in this blog to connect your app with Firebase and create a collection on the cloud firestore.

Using Firebase Firestore in Flutter
Fetching data from cloud firestoremedium.com

Here I have created a collection of items with name, imageUrl, and searchKeywords.

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

class CloudFirestoreSearch extends StatefulWidget {
@override
_CloudFirestoreSearchState createState() => _CloudFirestoreSearchState();
}

class _CloudFirestoreSearchState extends State<CloudFirestoreSearch> {
String name = "";

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: () {
Navigator.of(context).pop();
},
),
title: Card(
child: TextField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.search), hintText: 'Search...'),
onChanged: (val) {
setState(() {
name = val;
});
},
),
),
),
body: StreamBuilder<QuerySnapshot>(
stream: (name != "" && name != null)
? Firestore.instance
.collection('items')
.where("searchKeywords", arrayContains: name)
.snapshots()
: Firestore.instance.collection("items").snapshots(),
builder: (context, snapshot) {
return (snapshot.connectionState == ConnectionState.waiting)
? Center(child: CircularProgressIndicator())
: ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index) {
DocumentSnapshot data = snapshot.data.documents[index];
return Card(
child: Row(
children: <Widget>[
Image.network(
data['imageUrl'],
width: 150,
height: 100,
fit: BoxFit.fill,
),
SizedBox(
width: 25,
),
Text(
data['name'],
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 20,
),
),
],
),
);
},
);
},
),
);
}

}

Here we are using to control our screen view if the user search any item then the keyword entered by the user is set to name the variable then if inside the item collection searchKeyword array contains the keyword entered by the users then the data related to it flows through the stream and displayed on the screen.

This is the stream that we will use to see the search item or items.

Firestore.instance.collection('items').where("searchKeywords", arrayContains: name).snapshots()

Using the search Delegate

SearchDelegate is a pre-defined class inside the material.dart. This class provides us a predesigned search delegate. This class uses the following method to control the various operation to be performed to search for various items.

You can read about the method from the following link:

SearchDelegate class
Delegate for show search to define the content of the search page. The search page always shows an AppBar at the top…api.flutter.dev


buildAction method

This method returns the list of widgets to display after the search query in the AppBar.

List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.close),
onPressed: () {
close(context, null);
},
),
];
}

close(context, null) method is used to close the searchDelegate.


buildLeading method

Return a leading widget that is displayed before the query.

Widget buildLeading(BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: () {
close(context, null);
},
);
}

buildResult method

This method is used to build the result based on the keyword entered by the user.

 Widget buildResults(BuildContext context) {
return Center(
child: Text(
query,
style: TextStyle(
color: Colors.blue, fontWeight: FontWeight.w900, fontSize: 30),
),
);
}

buildSuggestions method

This method builds the suggestion list base on the keyword entered by the user as a query.

Widget buildSuggestions(BuildContext context) {
List<Item> items = [
Item(title: 'apple'),
Item(title: 'mango'),
Item(title: 'banana'),
Item(title: 'pineapple'),
Item(title: 'orange'),
Item(title: 'oranges'),
];
List<Item> suggestionList = query.isEmpty
? items
: items.where((element) => element.title.startsWith(query)).toList();
return suggestionList.isEmpty
? Text("no result found")
: ListView.builder(
itemBuilder: (context, index) {
return ListTile(
title: Text(suggestionList[index].title),
onTap: () {
showResults(context);
},
);
},
itemCount: suggestionList.length,
);
}

https://gist.github.com/anmolseth06/9840d5fb6856217324d1c86f2bad0258#file-searchdelegate-dart


Github Link

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


Conclusion

The search feature is very useful, we learned how to search for data using a search delegate it provides us a predefined architecture to perform searching easily and conveniently. We can also search for data from our database. The basic fundamental concept of both searches is the same.

I hope this article has provided you with content information about what’s all about the topic, and you will give it — a Try. Initiate using Search feature for your apps. !!!


🌸🌼🌸 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 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: Firebase Data Modeling Tips

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

What Is Flutter? Its Benefits and Limitations

0

The mobile development market is rapidly gaining momentum in recent years. In 2019, it was expected that it will cover 2.5 billion users and more than 80 billion dollars with the prospect of further growth. Gradually, there have been formed three key niches, which are the development for Android, iOS, and cross-platform solutions, that determine the market further development. The latter emerged as a way to quickly create applications for both dominant platforms, sacrificing the power of native development. The most famous solutions in this area were PhoneGap by Adobe, Xamarin by Microsoft, React Native by Facebook. In 2017, Google joined the group by introducing its Flutter framework at the annual Google I/O Conference. In December 2018, the stable version of Flutter was released, which turned it from an experimental SDK into a fully suitable for a commercial development tool.

What’s Flutter Anyway?

Flutter was a startup initiated by YC in 2013, after which Google acquired it. It is an open-source framework that can develop cross-platform applications using one codebase. Hence Flutter Android development is very same as its IOS development. This makes the development of apps smooth, easy, and quick. The language used to code in flutter is Dart, developed by Google, and unique to Flutter.

Developers can also use platform-specific widgets to make their app have a native-developed feel to it. This will keep the end-user satisfied, and developers can save a lot of time and effort while developing. Besides all this, Flutter has a charming and flexible UI which contributes a lot to a user-friendly UX. All of these features make flutter a must use in app development. You can also say this Google Flutter is the new React Native.

Flutter Timeline

Flutter’s beta version was launched on 13th March 2018 and it was first to live on 4th December 2018. In such a short amount of time, Flutter has already established its position in the market. Let’s take a look at the graph below to understand the popularity of Flutter as compared to other mobile platforms.

Does Flutter Have Any Benefits?

There are a number of benefits that Flutter offers to the entrepreneurs that make them look ahead to app development using Flutter.

Free and open source

It’s an open-source project which makes it available for use and study by start-ups for any given purpose. It’s more or less like an open-collaboration, hence making it easily accessible and user friendly. It not only gives you a diverse scope for design but also no other company provides you with as many options

Amazing Widget catalog

The best part about flutter is that you have a wide range of widgets beautifully cataloged for you. Not only does it make it hassle-free but also helps you make a functionally amazing app. You use Dart to write your Flutter app which is compiled to native code. The IntelliJ plugin makes for good integration.

It’s Inherent Graphic Library

Flutter uses the Skia — built-in library for rendering. This makes it more platform-independent. The SDK provides a rich set of widgets, in particular, the Material and Cupertino collections for rendering native-like widgets for Android and iOS. By combining various widgets, you get the opportunity to create a complex UI. Thanks to its own library, Flutter applications look the same on different versions of operating systems. Thus it is good to solve one of the main problems of mobile development today — the great variability of mobile devices.

Hot Reload

One of the drawbacks of compiled languages ​​before scripting languages ​​is the loss of time for building a project. With frequent edits, it can take up a substantial part of the working time. The Flutter Hot Reload feature allows you to display the effect of your edits in the code immediately.

Compatibility

Since widgets are part of the app and not the platform, you’ll likely experience less or no compatibility issues on different OS versions. This in turn means less time spent on testing.

Development Expectations for Fuchsia OS

Flutter is currently the only tool for creating applications for the Fuchsia OS from Google. For several years now, the new operating system has aroused the interest of developers and questions about its purpose. Particularly ardent fans call it the “Android killer,” which should blur the line between mobile, desktop, and web development. At Google itself, the new operating system is evaluated more restrainedly — as a testing ground for testing new ideas and experiments. Nevertheless, with the further development of Fuchsia, development experience with Flutter will allow you to quickly master a new niche in the software development market.

We’ve talked about Flutter and Fuchsia’s combination in detail in our previous blog. Do check that out.

It Gives You Java Feels

Dart isn’t exactly like Java but has similar features. It makes it really easy for developers to make the shift. Flutter comes with a better widget, great editorial integrations, and easy to use features that make this kit a great option to develop apps.

That’s not it, this framework is loaded with benefits that enhance the experience of the app for any user as well for the developer building it, those are:

What Flutter Can’t Do: Limitations

Although Flutter seems to be the future of app development with its continuous development and over the top features, there are a few limitations of Flutter which are yet to be improved.

Lack of Third-Party Libraries and Widgets

Flutter is not too old unlike its contemporaries and lacks the presence of third-party libraries. Although, it gives an amazing UI package, yet the requirement of third-party libraries for extensive development is still awaited.

For example, it’s rather easy to find libraries for React Native than Flutter. Also, some widgets in Flutter are specific to one platform. This may make some developers move away from Flutter if what they need is not available for their target platform.

Code Pushing

Code push allows developers to instantly push patches to their apps without going through the usual app store release process.

Bugs can be fixed without a new release, allowing a more web-like continuous development process. It’s supported by React Native, Cordova, and Ionic. Flutter doesn’t support this.

TVs, Watches & Cars

You can’t use Flutter to build apps for tvOS, watchOS, CarPlay, or Android Auto. There’s some limited support for Wear OS (formerly Android Wear). Flutter has to add Bitcode support to deploy to tvOS and watchOS. You’ll have to use native code or an alternative framework to target these platforms.

Some Top Performing Application Built With Flutter

Flutter Showcase consists of a plethora of applications that are increasing in multiple folds each day with large enterprises trusting flutter for their large userbase apps shows the amount of trust that Flutter offers.

Of the hundereds of applications built, there are some apps that really stood out, like:

Reflectly:

Reflectly is a personal journal and diary driven by artificial intelligence to enable you to deal with negative thoughts, make positivity louder, and to teach you about the science of well-being. An award-winning mindfulness app built with Flutter. It was featured on the Apple App Store as an ‘app of the day’.

Having 1 Million+ downloads with a rating of 4.3 from over 30,000 users.

PlayStore/ App Store

Hamilton:

This is the official application for one of the famous award-winning Broadway musicals — Hamilton. It was built specifically for its large community of fans to stay updated with all music-related news.

The app offers, along with other things, a karaoke feature for those who want to sing along to their favorite songs, access to a number of different Hamilton lotteries, a daily trivia game. The user experience of the app is outstanding on both platforms.

The app currently has 500,000+ users.

PlayStore/App Store

What Do We Think of Flutter?

Flutter was not always the same. We at FlutterDevs have been working on Flutter since it’s inception, its alpha release and we’ve seen Flutter and it’s community grow. There were a lot of challenges initially, which were resolved by the community itself.

Our experience of using Flutter as our driving technology for mobile app development has been phenomenal. We have been building apps for more than 10 years now, we have seen and used a lot of cross-platform frameworks. But need I say Flutter is hands-down the best cross-platform mobile app development framework. It

And as we discussed above in this article, there are some limitations and shortcomings with all the amazingness that this framework offers. One of the biggest limitations that we felt is that even though it’s one of the most popular cross-platform frameworks at this moment, we still have a limited developer community for Dart. But we know for a fact that it’s steadily growing.

Another big limitation that we came across is that it’s very hard to find plugins for a lot of 3rd party SDKs. In-turn, the developers have to create a plug-in specifically for the SDK and which will result in a lot of extra time and money from a client’s perspective as well.

Being said that, there is no doubt that Flutter is one of the best frameworks that we’ve ever worked on. Flutter takes fewer efforts, less time, and smaller investments for app development. The community behind flutter is smaller yet determined to set a higher standard of cross-platform development in 2020 and beyond.

Closing Thoughts

Flutter is hot in the market ever since Google announced the first stable release. Looking at the features of Flutter, lots of questions arise. Will companies go for Flutter as the first choice of developing apps? Is it the beginning of the end of the native Android app development? Will Dart replace Java and Kotlin? Should native Android developers start learning Dart?

We’ll make no predictions or guesses here, but it could be the alarming bell for native mobile app developers that something like Flutter might affect their role in the future.

Love Flutter or hate Flutter, you cannot ignore it anymore.


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

Spell Checker System In Flutter

0

The spell checker system is for the most part upheld by engines for the web and applications. For instance, as in the web with HTML, we have identified quality spellcheck for editable labels. With iOS or Android local, they additionally have spellCheckingType or Spell checker framework. However, not in Flutter, they’re setting spell checkers as a to-do for both the web and application.

This blog will explore the Spell Checker System In Flutter. We perceive how to execute a demo program. We will show you how to do a simple spell-checker system that can work well for your flutter 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

Code Implement

Code File

Conclusion



Introduction:

A spell checker is significant since your application has an editable text form. Furthermore, you would rather not depend on yourself while composing to accept that there are no mistakes. Then, having a spell checker can assist you a ton with incorrectly spelled words.

Demo Module ::

This demo video shows how to create the spell checker system in flutter and shows how a spell checker system will work in your flutter applications. We will show a user a spell checker that can help her find incorrect words. It will be shown on your devices.

Code Implement:

You need to implement it in your code respectively:

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

If you investigate the document for TextStyle, you can see there’s a segment where they referenced making a wavy red underline for black text. Along these lines, you can set the text style for each by switching over completely to TextSpan.

Here we go, we want to extend a custom TextEdittingController, I’ll call it CustomTextEdittingController, and give it a property listErrorTexts to store every one of the words that need a red underline on it.

Presently, you want to override the buildTextSpan technique by actually looking at listErrorTexts. On the off chance that your text matches any in listErrorTexts, give it a custom style. I utilized splitMapJoin controlled by Dart language to plan them into various TextSpans.

import 'package:flutter/material.dart';

class CustomTextEditingController extends TextEditingController {
final List<String> listErrorTexts;
CustomTextEditingController({String? text, this.listErrorTexts = const []})
: super(text: text);

@override
TextSpan buildTextSpan(
{required BuildContext context,
TextStyle? style,
required bool withComposing}) {
final List<TextSpan> children = [];
if (listErrorTexts.isEmpty) {
return TextSpan(text: text, style: style);
}
try {
text.splitMapJoin(
RegExp(r'\b(' + listErrorTexts.join('|').toString() + r')+\b'),
onMatch: (m) {
children.add(TextSpan(
text: m[0],
style: style!.copyWith(
decoration: TextDecoration.underline,
decorationStyle: TextDecorationStyle.wavy,
decorationColor: Colors.red),
));
return "";
}, onNonMatch: (n) {
children.add(TextSpan(text: n, style: style));
return n;
});
} on Exception catch (e) {
return TextSpan(text: text, style: style);
}
return TextSpan(children: children, style: style);
}
}

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

For the word reference, you can utilize this list_english_words however for my purposes, that package has an excessive number of words (~380k words) and many are repetitive for the standard English language. So I got my rundown which is just about ~84k words. Yet, I will show you a few words.

const List<String> listEnglishWords = [
'a',
'aa',
'aaa',
'aachen',
'aardvark',
'aardvarks',
'aaron',
'ab',
'aba',
'ababa',
'abaci',
'aback',
'abactor',
'abactors',
'abacus',
'abacuses',
'abaft',
'abalone',
'abandon',
'abandoned',
'abandonee',
'abandonees',
'abandoning',
'abandonment',
'abandons',
'abase',
'abased',
'abasement',
'abases',
'abash',
'abashed',
'abashes',
'abashing',
'abasing',
'abatable',
'abate',
'abated',
'abatement',
'abatements',
'abater',
'abaters',
'abates',
'abating',
'abator',
'abators',
'abattoir',
'abattoirs',
'abbacies',
'abbacy',
'abbess',
'abbesses',
'abbey',
'abbeys',
'abbot',
'abbots',
'abbotsbury',
'abbott',
'abbreviate',
'abbreviated',
'abbreviates',
'abbreviating',
'abbreviation',
'abbreviations',
'abbreviator',
'abbreviators',
'abc',
'abdicant',
'abdicants',
'abdicate',
'abdicated'
];

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

First, we will add two final List<String> listErrorTexts and listTexts are equal to the square bracket. Also, we will add CustomTextEditingController was _controller.

final List<String> listErrorTexts = [];

final List<String> listTexts = [];

CustomTextEditingController _controller = CustomTextEditingController();

We will create an initState() method. In this method, we will add _controller is equal to the CustomTextEditingController(listErrorTexts: listErrorTexts)

@override
void initState() {
_controller = CustomTextEditingController(listErrorTexts: listErrorTexts);
super.initState();
}

The thought is straightforward, each time you type the word and hit the space, then you check for the word just before it. On the off chance that it is incorrectly spelled, add it to listErrorTexts, if not you’ll, in any case, have to save it in a stored array so when this word shows up again you don’t have to query in the word reference any longer.

I made a TextFormField widget in a different file and a capability called handleSpellCheck relegated to the onChange event of TextFormField.

void _handleOnChange(String text) {
_handleSpellCheck(text, true);
}

void _handleSpellCheck(String text, bool ignoreLastWord) {
if (!text.contains(' ')) {
return;
}
final List<String> arr = text.split(' ');
if (ignoreLastWord) {
arr.removeLast();
}
for (var word in arr) {
if (word.isEmpty) {
continue;
} else if (_isWordHasNumberOrBracket(word)) {
continue;
}
final wordToCheck = word.replaceAll(RegExp(r"[^\s\w]"), '');
final wordToCheckInLowercase = wordToCheck.toLowerCase();
if (!listTexts.contains(wordToCheckInLowercase)) {
listTexts.add(wordToCheckInLowercase);
if (!listEnglishWords.contains(wordToCheckInLowercase)) {
listErrorTexts.add(wordToCheck);
}
}
}
}

bool _isWordHasNumberOrBracket(String s) {
return s.contains(RegExp(r'[0-9\()]'));
}

In the body, we should wrap your TextFormField with a Focus widget to recognize whether the client’s mouse has lost focus. One more, It’s more helpful on the off chance that you carry out a custom TextFormField and can re-use it anyplace. Then you want to allocate the default value to your CustomTextEdittingController in initState().

Column(
children: [
Image.asset("assets/logo.png",width: 300,height: 200,),
Container(
padding: const EdgeInsets.all(36.0),
width: 400,
child: Focus(
onFocusChange: (hasFocus) {
if (!hasFocus) {
_handleSpellCheck(_controller.text, false);
}
},
child: TextFormField(
controller: _controller,
onChanged: _handleOnChange,
minLines: 5,
maxLines: 10,
decoration: const InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)))),
),
),
],
),

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

Output

Code File:

import 'package:flutter/material.dart';

import 'custom_text_editing_controller.dart';
import 'list_english_words.dart';

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

@override
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
final List<String> listErrorTexts = [];

final List<String> listTexts = [];

CustomTextEditingController _controller = CustomTextEditingController();

@override
void initState() {
_controller = CustomTextEditingController(listErrorTexts: listErrorTexts);
super.initState();
}

void _handleOnChange(String text) {
_handleSpellCheck(text, true);
}

void _handleSpellCheck(String text, bool ignoreLastWord) {
if (!text.contains(' ')) {
return;
}
final List<String> arr = text.split(' ');
if (ignoreLastWord) {
arr.removeLast();
}
for (var word in arr) {
if (word.isEmpty) {
continue;
} else if (_isWordHasNumberOrBracket(word)) {
continue;
}
final wordToCheck = word.replaceAll(RegExp(r"[^\s\w]"), '');
final wordToCheckInLowercase = wordToCheck.toLowerCase();
if (!listTexts.contains(wordToCheckInLowercase)) {
listTexts.add(wordToCheckInLowercase);
if (!listEnglishWords.contains(wordToCheckInLowercase)) {
listErrorTexts.add(wordToCheck);
}
}
}
}

bool _isWordHasNumberOrBracket(String s) {
return s.contains(RegExp(r'[0-9\()]'));
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter Spell Checker Demo'),
backgroundColor: Colors.cyan,
automaticallyImplyLeading: false,
centerTitle: true,
),
body: Column(
children: [
Image.asset("assets/logo.png",width: 300,height: 200,),
Container(
padding: const EdgeInsets.all(36.0),
width: 400,
child: Focus(
onFocusChange: (hasFocus) {
if (!hasFocus) {
_handleSpellCheck(_controller.text, false);
}
},
child: TextFormField(
controller: _controller,
onChanged: _handleOnChange,
minLines: 5,
maxLines: 10,
decoration: const InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black)))),
),
),
],
),
);
}
}

Conclusion:

In the article, I have explained the Spell Checker System structure in a flutter; you can modify this code according to your choice. This was a small introduction to Spell Checker System User Interaction from my side, and it’s working using Flutter.

I hope this blog will provide you with sufficient information on Trying the Spell Checker System in your flutter projectsWe will show you what the Introduction is and make a demo program for working with Spell Checker System 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! 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: SMS Using Twilio In Flutter

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


PDF with Flutter

In Flutter there are various features that make you app rich in functionality and provide ease to the user to do stuff within the app and get better user experience and being a service provider it is also necessary for developers.

These small but important functionalities like picking up contacts from the contact list, images, and videos from the gallery, opening maps, automatic OTP recognition, are some important features that make any app comfortable to use and in this article, we are going to explain a simple but important functionality named pdf viewer.

There are different packages which you can use to open a pdf in your app some are a bit complicated and some are easy to implement and here I am going to explain one of the easiest ways to use it.

Implementation:

For this, you just need to add the dependencies in your pubspec.yaml file

pdf_flutter: 
file_picker:

After adding dependencies you have different options to use it, It depends, from where you want to access your pdf like from assets, from your phone storage, or by any link(from server).

So let’s see all methods of accessing pdf from different locations

From asset Folder

From the asset folder, you can easily access your pdf file if you have mentioned it in your pubspec.yaml file. Here you are also required to mention placeholder in case of unavailability of resources.

PDF.assets(
"assets/demo.pdf",
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
placeHolder: Image.asset("assets/images/pdf.png",
height: 200, width: 100),
),

From Phone Storage

Some times you need to access pdf from your phone especially in the case when you are posting any document in the server. The only thing which is different from the above code is PDF.file and but as we are picking it up from phone so we need to add the dependency of file_picker then we need to create an instance of the file picker

File localFile;

and then it will allow you to access your phone directory

PDF.file(
localFile,
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
placeHolder: Image.asset(
"assets/images/pdf.png",
height: 200, width: 100
),
),

From Server

Accessing pdf file is quite the same as the two mentioned methods you only need to use PDF.network and need to provide the link and this will show the pdf on your device

PDF.network(
'https://google-developer-training.github.io/android-developer-fundamentals-course-concepts/en/android-developer-fundamentals-course-concepts-en.pdf',
height: 300,
width: 200,
placeHolder: Image.asset("assets/images/pdf.png",
height: 200, width: 100),
),

So these were the best methods to access pdf in from flutter as far as simplicity is a concern.

Demo

You can find source code from here :

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

Conclusion

There are different Pdf viewer plugins are available here but this one is the simplest among them because in this plugin you get riddance from all kinds of long and lengthy code, this is the simplest way to view pdf in a flutter.


Thanks for reading this article if you find anything that could be improved please let me know, I would love to improve.💙

If this article has helped you a bit and found interesting please clap!👏


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

www.flutterdevs.com

Rest API in Flutter

0

Introduction

Hello and welcome to my new blog on Rest API in Flutter. In this blog, we shall discuss fetching data, deleting data, updating data using a JSON file. Nowadays the use of API in an app is very common, almost every app we use in daily life use API to display the uses data. We will use http package, which provides advanced methods to perform various operations. REST API uses a simple http calls to communicate with JSON data. Each request returns a Future<Response>.


Table of content

Need of http package & methods

Setting up the project

Creating a simple get Request

Handling the error code

Decoding the JSON data

Creating UI classes

Displaying the response on the screen

Updating the data

Deleting the data

Sending the data


Need of http Package?

  • :: It uses await and async feature.
  • :: It provides various method.
  • :: It provides class and http to perform web request.

:: Core Methods in http package?

Listing Http package methods woth giving a try and of much usage

  1. post Method

:: This method uses a URL and POST method to post the data and return a Future<Response>. It is used to send the data on the web.

2. get Method

:: get method uses a URL and fetches the data in JSON format.

3. delete Method

:: This method is used to delete the data using the DELETE method.

4. head Method

:: Uses the URL to request the data using the HEAD method and return the response as Future<Response>.

5. read Method

:: It is similar as get method, used to read the data.

6. put Method

:: It uses the specified URL and update the data specified by the user using the PUT method.

7. patch Method

It is very similar to the put method, used to update the data.

:: Setting up the Project

Install the http dependency

Add the following dependency in pubspec.yaml file

dependencies:
http:

Import the package as http

import 'package:http/http.dart' as http;

Also Import import 'dart:convert'; to convert the JSON data.

: Creating a Request

Future<List<Fruit>> fetchFruit() async {
final response = await http.get(url);
}
String url = "Your_URL";

This is the basic request using get method to fetch the data from the specified URL in the JSON format.

: Handling the error code

final response = await http.get(
'url');
if (response.statusCode == 200) {
//displaY UI
} else {
//SHOW ERROR MESSAGE
}
}

If the response status code is 200 then we can display the requested data otherwise we can show the error message to the users.

: Decoding the JSON data

List<Fruit> decodeFruit(String responseBody) {
final parsed = json.decode(responseBody).cast<Map<String, dynamic>>();
return parsed.map<Fruit>((json) => Fruit.fromMap(json)).toList();
}

: Creating a Fruit class

class Fruit {
final int id;
final String title;
final String imageUrl;
final int quantity;

Fruit(
this.id,
this.title,
this.imageUrl,
this.quantity,
);
factory Fruit.fromMap(Map<String, dynamic> json) {
return Fruit(json['id'], json['title'], json['imageUrl'], json['quantity']);
}
factory Fruit.fromJson(Map<String, dynamic> json) {
return Fruit(json['id'], json['title'], json['imageUrl'], json['quantity']);
}
}

:: Creating a FruitList class

import 'package:flutter/material.dart';
import 'fruit.dart';
import 'fruitItem.dart';

class FruitList extends StatelessWidget {
final List<Fruit> items;

FruitList({Key key, this.items});

@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return FruitItem(item: items[index]);
},
);
}
}

: Creating the FruitItem

import 'package:flutter/material.dart';

import 'fruit.dart';

class FruitItem extends StatelessWidget {
FruitItem({this.item});

final Fruit item;

Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(2),
height: 140,
child: Card(
elevation: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Image.network(
this.item.imageUrl,
width: 200,
),
Expanded(
child: Container(
padding: EdgeInsets.all(5),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(this.item.title,
style: TextStyle(fontWeight: FontWeight.bold)),
Text("id:${this.item.id}"),
Text("quantity:${this.item.quantity}"),
],
)))
]),
));
}
}

: Displaying the response on the screen

class MyHomePage extends StatelessWidget {
final String title;
final Future<List<Fruit>> products;

MyHomePage({Key key, this.title, this.products}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Product Navigation"),
),
body: Center(
child: FutureBuilder<List<Fruit>>(
future: products,
builder: (context, snapshot) {
if (snapshot.hasError) print(snapshot.error);
return snapshot.hasData
? FruitList(items: snapshot.data)
: Center(child: CircularProgressIndicator());
},
),
));
}
}
Decoding JSON data to display the UI

: Updating the data

Future<Fruit> updateFruit(String title) async {
final http.Response response = await http.put(
'url/$id',
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{
'title': title,
}),
);

if (response.statusCode == 200) {
return Fruit.fromJson(json.decode(response.body));
} else {
throw Exception('Failed to update album.');
}
}

: Deleting the data

Future<Fruit> deleteAlbum(int id) async {
final http.Response response = await http.delete(
'url/$id',
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
);

if (response.statusCode == 200) {
return Fruit.fromJson(json.decode(response.body));
} else {
throw Exception('Failed to delete album.');
}
}

: Sending the data

Future<Fruit> sendFruit(
String title, int id, String imageUrl, int quantity) async {
final http.Response response = await http.post(
'url',
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{
'title': title,
'id': id.toString(),
'imageUrl': imageUrl,
'quantity': quantity.toString()
}),
);
if (response.statusCode == 201) {
return Fruit.fromJson(json.decode(response.body));
} else {
throw Exception('Failed to load album');
}
}

Github Link

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

🌸🌼🌸 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 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: Rest API Using GetX

Related: Integrating REST APIs into Your FlutterFlow App

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

Charts in Flutter

0

Introduction

In this blog, we shall discuss how to implement various types of charts in flutter. Charts are very useful to picture the huge amount of data in simple and explanatory for. Establish a relationship between different types of data. Line charts, pie charts, and Bar charts are more frequently used charts in daily life because they are easy to examine. There are various methods that can be used to extract meaningful content from the given data.


Table of content

Adding charts dependency

Area Chart

Line Chart

Spline Chart

Column Chart

Bar Chart

Github Link


Adding charts dependency

This package provides us a lot of variety of charts. Also, there are lots of properties that can be used to make our charts more interactive and easy to understand.

syncfusion_flutter_charts | Flutter Package
Add this to your package’s pubspec.yaml file: dependencies: syncfusion_flutter_charts: ^18.2.46 You can install…pub.dev

dependencies:
  syncfusion_flutter_charts: ^latest version

Area chart

Initializing our first chart

Widget _chart() {
return SfCartesianChart();
}

SfCartesianChart this class provides us access with various types of cartesian charts such as line charts, bar charts, Spline charts, etc, and various properties the design our chart more attractive and easy to understand.

Charts with title

Widget _areaChart() {
return SfCartesianChart(
title: ChartTitle(text: "Area Chart"),
);
}

title property is used to initialize the chart title.

Chart with ChartSeries

Widget _areaChart() {
return SfCartesianChart(
title: ChartTitle(text: "Area Chart"),
series: <ChartSeries>[
AreaSeries()
]);
}

series property provides use ChartSeries i.e type of chart that we need to initialize. AreaSeries is used to make a are chart.

Charts with Data

Widget _areaChart() {
return SfCartesianChart(
title: ChartTitle(text: "Area Chart"),
series: <ChartSeries>[
AreaSeries<SalesData, double>(
dataSource: chartData,
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales)
]);
}

Since this type of chart is a cartesian chart, so it will have two dimensions i.e. x, y-axis. AreaSeries class provides us properties xValueMapper and yValueMapper to map our values on the respective axis.

We have created a class SalesData that have two properties year, sales .

class SalesData {
SalesData(this.year, this.sales);

final double year;
final double sales;
}

dataSource property contains the source of data.

List<SalesData> chartData = [
SalesData(2004, 7),
SalesData(2005, 5),
SalesData(2006, 9),
SalesData(2007, 2),
SalesData(2008, 10)
];

Line chart

Widget _lineChart() {
return SfCartesianChart(
primaryXAxis: CategoryAxis(),
title: ChartTitle(text: 'Line Charts'),
series: [
LineSeries<SalesData, double>(
dataSource: chartData,
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales,
)
],
);
}

Transposed Chart

isTransposed property is used to transpose or reverse the chart.

Widget _lineChart() {
return SfCartesianChart(
isTransposed: true,
title: ChartTitle(text: 'Line Charts'),
series: [
LineSeries<SalesData, double>(
dataSource: chartData,
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales,
)
],
);
}

Spline Chart

Widget _splineChart() {
return SfCartesianChart(
title: ChartTitle(text: "Spine Chart"),
series: <ChartSeries>[
SplineSeries<SalesData, double>(
dataSource: chartData,
cardinalSplineTension: 0.9,
splineType: SplineType.natural,
dashArray: <double>[1, 3],
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales),
],
);
}

Enable DataLevel

DataLevelSetting class provides us isVisible a property to display the data levels.

Widget _splineChart() {
return SfCartesianChart(
title: ChartTitle(text: "Spine Chart"),
series: <ChartSeries>[
SplineSeries<SalesData, double>(
dataSource: chartData,
cardinalSplineTension: 0.9,
splineType: SplineType.natural,
dataLabelSettings: DataLabelSettings(
showCumulativeValues: true,
isVisible: true,
),
dashArray: <double>[1, 3],
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales),
],
);
}

Column Chart

Widget _columnChart() {
return SfCartesianChart(
title: ChartTitle(text: "Column Chart"),
series: <ChartSeries>[
ColumnSeries<SalesData, double>(
dataSource: chartData,
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales),
],
);
}

Bar Chart

Widget _barChart() {
return SfCartesianChart(
title: ChartTitle(text: "Bar Chart"),
series: <ChartSeries>[
// Renders bar chart
BarSeries<SalesData, double>(
dataSource: chartData,
xValueMapper: (SalesData sales, _) => sales.year,
yValueMapper: (SalesData sales, _) => sales.sales)
]);
}

You can also use fl_charts package to implement charts:

fl_chart | Flutter Package
💥 A library to draw fantastic charts in Flutter 💥 ScatterChart Coming Soon Read More Banner designed by…pub.dev

Github Link

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


🌸🌼🌸 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 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.

Spinkit In Flutter

0

Might it be said that you are exhausted with your normal CircularProgressIndicator utilizing as a Loader? Be that as it may, you are excessively languid to customize your loader. Look at Spinkit in flutter which gives you different various types of loading indicators.

While the application is loading information from the API or database, we show a loader to demonstrate that it’s handling information.

In this blog, we will explore Spinkit In Flutter. We will also implement a demo program, and learn how to make a collection of loading indicators animated using the flutter_spinkit package in your flutter applications.

flutter_spinkit | Flutter Package
A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin’s SpinKit. dependencies…pub.dev

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

How to use

Implementation

Code Implement

Code File

Conclusion



Introduction:

Spinkit is a collection of loading indicators animated with flutter. It has colossal animated loading indicators which are essentially utilized when we are stacking something.

Like Loading an Application, a video download is underway to demonstrate this we’re involving pointers for that specific activity, stacking of information from the data set, saving information in the data set, and so on.

Demo Module ::

This demo video shows how to make loading indicators animated in a flutter and shows how a Spinkit will work using the flutter_spinkit package in your flutter applications. We will show a user different types of loading indicator animations will be shown on your devices.

How to use:

It is pretty simple to use it.

const spinkit = SpinKitRotatingCircle(
color: Colors.white,
size: 50.0,
);

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:
flutter:
sdk: flutter
flutter_spinkit: ^latest version

Step 2: Import

import 'package:flutter_spinkit/flutter_spinkit.dart';

Step 3: Run flutter packages get in the root directory of your app.

How to implement code in dart file :

You need to implement it in your code respectively:

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

Create a SpinkitDemo class stateless widget and return the scaffold & give the title in AppBar as you like. There are many indicators to be used so I won’t go over them all. This post should serve as a cheat sheet for all the widgets you can use.

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blueGrey,
automaticallyImplyLeading: false,
centerTitle: true,
title: const Text('Flutter Spinkit Demo'),
),
);
}
}

Presently in the body, we will add GridView.count with crossAxisCount was three, and afterward, use SpinKit. This is how we use SpinKIt. You can utilize its various properties as indicated by your need like size, span, stroke width, and so on.
There are bunches of various kinds of Spinkit loaders. We have quite recently shown a couple of them for execution.

body: GridView.count(crossAxisCount: 3,
children: const [
SpinKitCubeGrid(color: Colors.red,),
SpinKitCircle(color: Colors.lightBlueAccent,),
SpinKitDancingSquare(color: Colors.teal,),
SpinKitDualRing(color: Colors.pinkAccent),
SpinKitDoubleBounce(color: Colors.lightBlueAccent,),
SpinKitFadingFour(color: Colors.yellow,),
SpinKitFoldingCube(color: Colors.amber,),
SpinKitHourGlass(color: Colors.deepOrangeAccent),
SpinKitRipple(color: Colors.cyan,),
SpinKitPianoWave(color: Colors.black,),
SpinKitPouringHourGlass(color: Colors.brown),
SpinKitThreeInOut(color: Colors.amber,)
],
),

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_spinkit/flutter_spinkit.dart';
import 'package:flutter_spinkit_demo/splash_screen.dart';


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

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

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Splash(),
);
}
}

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blueGrey,
automaticallyImplyLeading: false,
centerTitle: true,
title: const Text('Flutter Spinkit Demo'),
),
body: GridView.count(crossAxisCount: 3,
children: const [
SpinKitCubeGrid(color: Colors.red,),
SpinKitCircle(color: Colors.lightBlueAccent,),
SpinKitDancingSquare(color: Colors.teal,),
SpinKitDualRing(color: Colors.pinkAccent),
SpinKitDoubleBounce(color: Colors.lightBlueAccent,),
SpinKitFadingFour(color: Colors.yellow,),
SpinKitFoldingCube(color: Colors.amber,),
SpinKitHourGlass(color: Colors.deepOrangeAccent),
SpinKitRipple(color: Colors.cyan,),
SpinKitPianoWave(color: Colors.black,),
SpinKitPouringHourGlass(color: Colors.brown),
SpinKitThreeInOut(color: Colors.amber,)
],
),

);
}
}

Conclusion:

In the article, I have explained Spinkit’s basic structure in a flutter; you can modify this code according to your choice. This was a small introduction to Spinkit On User Interaction from my side, and it’s working using Flutter.

I hope this blog will provide you with sufficient information on Trying up the Spinkit in your flutter projectsWe will show you what the Introduction is. Make a demo program for working Spinkit and you’ve learned how to make a loading indicator animated using the flutter_spinkit package 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 FacebookGitHubTwitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope 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.


Scanning & Generating QR code in Flutter

0

Introduction

In this blog, we shall discuss how to generate and scan QR code in your Flutter app. QR code is widely used by the payment gateway and in many other services because they can store text, URL, email address, ph. numbers or any other form of data. Nowadays QR code scanning can be done very easily through mobile phones, they do not require special devices for scanning.

Key Features of Bar code and QR code

  1. Safe and secure, they are only readable by machines.
  2. They can store any form of data easily
  3. Quick Response
  4. Data stored in static QR codes can not be edited.
  5. Easy to generate and scan

Table of content

  1. Installing Package
  2. Generate QR code
  3. Scan QR code
  4. GitHub Link

:: Installing Package

Update your pubspec.yaml file with the following package:

barcode_scan | Flutter Package
example/lib/main.dart import ‘dart:async’; import ‘dart:io’ show Platform; import…pub.dev

qr_flutter | Flutter Package
QR. Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.pub.dev

dependencies:
barcode_scan:
qr_flutter:

:: Generate QR code

Import import ‘package:qr_flutter/qr_flutter.dart’;

Let’s build a text field to take input from the user:

Initialize a textEditingController for the field:

TextEditingController qrTextController = TextEditingController();

Create a text field with hint text:

TextField(
controller: qrTextController,
decoration: InputDecoration(
hintText: "please enter some data",
),
),

Code to design the text field:

Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
elevation: 5,
child: ListTile(
leading: Icon(Icons.edit),
trailing: FlatButton(
child: Text(
"ENTER",
style: TextStyle(
color: Colors.white,
),
),
color: Colors.green,
onPressed: () {
},
),
title: TextField(
controller: qrTextController,
decoration: InputDecoration(
hintText: "please enter some data",
),
),
),
),
),

Submitting the text entered by the user to the QR code data:

onPressed: () {
setState(() {
dummyData = qrTextController.text == ""
? null
: qrTextController.text;
});
},

dummyData is a string that is the data for QR code. Here I have declared a condition to specify the dummyData , if the qrTextController is “” then it will be null otherwise qrTextController will be the data of the dummyData string.

Creating a QrImage

import 'package:qr_flutter/qr_flutter.dart'; package provides us QrImage() class to create a code image of the data given by the user.

QrImage(
data: dummyData,
),

Creating a QrImage with embeddedImage

QrImage(
embeddedImage: NetworkImage(
"https://avatars1.githubusercontent.com/u/41328571?s=280&v=4",
),
data: dummyData,
),

generate.dart

import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
class GeneratePage extends StatefulWidget {
@override
State<StatefulWidget> createState() => GeneratePageState();
}
class GeneratePageState extends State<GeneratePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Generate QR code'),
),
body: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
elevation: 5,
child: ListTile(
leading: Icon(Icons.edit),
trailing: FlatButton(
child: Text(
"ENTER",
style: TextStyle(
color: Colors.white,
),
),
color: Colors.green,
onPressed: () {
setState(() {
dummyData = qrTextController.text == ""
? null
: qrTextController.text;
});
},
),
title: TextField(
controller: qrTextController,
decoration: InputDecoration(
hintText: "please enter some data",
),
),
),
),
),
(dummyData == null)
? Center(child: Text("enter some text to display qr code..."))
: QrImage(
embeddedImage: NetworkImage(
"https://avatars1.githubusercontent.com/u/41328571?s=280&v=4",
),
data: dummyData,
gapless: true,
),
],
),
);
}
}
String dummyData;
TextEditingController qrTextController = TextEditingController();

:: Scan Qr Code

Import import ‘package:barcode_scan/barcode_scan.dart’; and initialize the

String qrCodeResult; variable to store the result of the Qr code.

Creating a scan function

Future<void> _scan() async {
ScanResult codeSanner = await BarcodeScanner.scan();
}

BrcodeScanner class provides us scan() method to scan the Qr code. BarcodeScanner.scan() returns a ScanResult that contains the text return by the Qr Code scanner.

Setting up the result of the scanner to the qrCodeResult

Future<void> _scan() async {
ScanResult codeSanner = await BarcodeScanner.scan(),
);
setState(() {
qrCodeResult = codeSanner.rawContent;
});
}

Setting up the camera option

scan() method contains option a property that can be used to change the camera (eg. front Camera or Back Camera).

Future<void> _scan() async {
ScanResult codeSanner = await BarcodeScanner.scan(
options: ScanOptions(
useCamera: camera,
),
);
}
int camera = 1;

ScanOptions provides us useCamera property to change the camera type.

  1. useCamera takes an integer 1 or -1.
  2. If useCamera value is 1 then the front Camera works to scan the Qr code.
  3. If useCamera value is -1 then back camera works to scan the Qr code.

To switch the camera I have built the following logic:

appBar: AppBar(
title: Text("Scan using:" + (backCamera ? "Front Cam" : "Back Cam")),
actions: <Widget>[
IconButton(
icon: backCamera
? Icon(Ionicons.ios_reverse_camera)
: Icon(Icons.camera),
onPressed: () {
setState(() {
backCamera = !backCamera;
camera = backCamera ? 1 : -1;
});
},
)
],
),

Initializing the scan() function

IconButton(
icon: Icon(MaterialCommunityIcons.qrcode_scan),
onPressed: () {
_scan();
},
)

Displaying the result

Center(
child: Text(
(qrCodeResult == null) || (qrCodeResult == "")
? "Please Scan to show some result"
: "Result:" + qrCodeResult,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w900),
),
)

scan.dart

import 'package:barcode_scan/barcode_scan.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';

class ScanPage extends StatefulWidget {
@override
_ScanPageState createState() => _ScanPageState();
}

class _ScanPageState extends State<ScanPage> {
String qrCodeResult;
bool backCamera = true;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Scan using:" + (backCamera ? "Front Cam" : "Back Cam")),
actions: <Widget>[
IconButton(
icon: backCamera
? Icon(Ionicons.ios_reverse_camera)
: Icon(Icons.camera),
onPressed: () {
setState(() {
backCamera = !backCamera;
camera = backCamera ? 1 : -1;
});
},
),
IconButton(
icon: Icon(MaterialCommunityIcons.qrcode_scan),
onPressed: () {
_scan();
},
)
],
),
body: Center(
child: Text(
(qrCodeResult == null) || (qrCodeResult == "")
? "Please Scan to show some result"
: "Result:" + qrCodeResult,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w900),
),
));
}

Future<void> _scan() async {
ScanResult codeSanner = await BarcodeScanner.scan(
options: ScanOptions(
useCamera: camera,
),
);
setState(() {
qrCodeResult = codeSanner.rawContent;
});
}
}

int camera = 1;

Our app will look like this

Scan and generate Qr Code Demo App

:: GitHub Link

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


🌸🌼🌸 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 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: Improve code style using lint rules in Flutter

Related: Pin Code Fields In Flutter

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

Firebase Dynamic Links In Flutter

0

Flutter & Firebase have both Transformed into an Omnipotent Integral part of Developers Community corresponding to their Innate Ability of Never-Ending Scope of Development Covering Multiple platforms like — Android, iOS, Web and Desktop Apps with Incessant Dire focus on Making Performant Apps. While both of them have made their Introducing recently, they have gained Immense Popularity & Acceptance in a flash and are now widely trusted by the largest apps around the globe 🌐.

Firebase Dynamic Links provides a rich feature for handling deep linking for applications and websites. The best part is that Firebase deep linking is free, for any scale. Dynamic Links instead of redirecting the user to the playstore bring-in Optimal User Experience by also navigating him to the Intended Equivalvent content in web/app apparently contributing to building ,improving and growing application for multiple platform domains.

In this article: I will explain how to create and use Dynamic Links in Flutter :

Table of Contents:

:: Flutter — Introduction

:: Firebase — Introduction

:: Firebase Dynamic Links — Introduction, working pattern , advantages

:: Firebase Dynamic Links — Setup Initial Configuration

:: Firebase Dynamic Links — Firebase Console /Flutter Codebase

:: Closing Thoughts


Intro to the Topic: Firebase Dynamic Links 🚀

Firebase Dynamic Links — needs, usability, Integration in Flutter codebase, Creating Dynamic Links Through Console, or programming in our apps. Dynamic Links are easily customizable to define their performant activity on the basis of the various platform with the innate ability to track link performance on various platforms, percentage intended action happening, click numbers

Dynamic Links is a smart link that can be differently handled on the basis of platform as per choice that allows you to send existing & potential users to any location within your iOS or Android app by surviving the install process so that even new users see the content they’re looking for when they open the app for the first time.

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.

/media/eaefff34fddcc032a2b4fe36aa69b8a9Flutter Introduction Video

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

Flutter is Proudly Entrusted By These Organizations For their Products: — Flutter Showcase

Click to See Flutter Showcase

What is Firebase?

Firebase is Google’s mobile platform that helps you quickly develop high-quality apps and grow your business

Firebase is a powerful platform for your mobile and web application. Firebase can power your app’s backend, including data storage, user authentication, static hosting, and more. With Firebase, you can easily build mobile and web apps that scale manifolds.

Let us have a glimpse of Firebase 🔥, and all the tools and services that it provides :

  • :: Build Better Apps — Firebase lets you build more powerful, secure and scalable apps with the help of firebase functionalities like Cloud Firestore , ML Kit , Cloud Functions, Hosting , Authentication , Cloud Storage , Real Time Database enhancing the app quality and monitor performance .
  • :: Improve app quality — Firebase gives you insights into app performance and stability, so you can channel your resources effectively using functionalities like Crashlytics , Performance Monitoring , Test Labs .
  • :: Grow your business — Firebase helps you grow to millions of users, simplifying user engagement and retention using it’s functionalities like In-App Messaging , Google Analytics , A/B Testing , Predictions , Cloud Messaging(FCM) , Remote Configuration , Dynamic Links , App Indexing

As Flutter can be readily used to develop applications for multiple platforms, Firebase products work significantly great by sharing Data and Insights so that they can work profoundly better together.

For more information about Firebase, please visit the official Firebase website.

Firebase Showcase :

Click to know more about Firebase

Firebase Dynamic Links: Knowabouts

🚀 Turn Desktop Users ⇄ Mobile App Users

Firebase Dynamic Links can Apparently turn out to be a catalyst in Migrating Users from your website to a similar content in the mobile app.

This can be readily done by giving users an effortless way to send themselves a deep link that will open in the right context within your app on your mobile device (even if they need to install the app first). If the app is not installed then on clicking the link the user will be prompted to install the app. Once Installed, the user may be able to access the Link shared.

making web users acquainted with mobile apps

🚀 Drive more installs with social, email, and SMS Marketing campaigns

Firebase Dynamic Links are employed in Promotional Campaigns that are aimed for users across all platforms. If the link revolves around a Discount offering, when a user installs or opens your app they see the exact content needed, Irrespective of platform & app installed or not.

Firebase Dynamic links can be attached with unique Identifiers that are able to track campaigns on various parameters to help in identification that what campaigns are getting us the high-quality users, & providing users a customized first-time experience based on their campaigns.

Working Pattern: Firebase Dynamic Links

Let us understand the working pattern of Firebase Dynamic Links:-

Dynamic links provide a way for deep links to survive the installation step and in such a way that the user always gets the Intended Context.

Working Pattern: Firebase Dynamic Links

If you wish to learn more about Firebase Dynamic Links, you can check out the following video made by firebase :

Firebase Dynamic Links handles the following scenarios :

  • :: If the user opens dynamic links , if app isn’t installed in the device then the user is automatically redirected to the playstore/appstore to install your app to access the link.
  • :: if the app is installed in the device but not open in the foreground, then opening on link will open up the application on device .
  • :: if the app is in the foreground , then the user can get a dynamic link in the registered listener

Setup & Initial Configuration

In order to send Firebase Dynamic Links, We need to create a firebase project for the Firebase Dynamic Links from firebase.google.com by logging in with your Google account. This brings us to the following screen:

Add project at Firebase Console

click on Add Project Button (+) initiating firebase project creation process.

Mention Name of project

Select the appropriate name for the project entering continue further

select analytics (if needed )

You can either select the firebase analytics and then clicking on Continue Project. Firebase Project is now created and ready to use .

Firebase project created

This Progress indicator will show before the dashboard indicating success.

Dashboard Screen

In the project overview page, click the iOS icon to launch the setup workflow as we now needs to register your flutter project for the android and iOS application.

Integration with iOS App

In the project overview page, select the iOS icon to launch the setup flow. If you have already added the app to your project provide click on add app to provide details of your application.

Enter iOS Bundle ID
  1. Register your app with Firebase :
  2. a. Provide with your app’s bundle ID.
    Find this bundle ID from your open project in XCode. Select the top-level app in the project navigator, then access the General tab. The Bundle Identifier value is the iOS bundle ID (for example, com.yourcompany.ios-app-name).
    b. You may also provide optional details like App Nick Name and App Store ID.
    c. Register your app.

Make sure you enter the correct ID As this can’t be edited further at the moment .

Download GoogleService-Info.plist

Next step, We need to download the config file named GoogleService-info.plist & repeating a similar process to registering your android app there saving the Google-service.json file. Keep those configuration files in ready-to-use with Flutter app later.

  • Open Project Settings in the Firebase console and select iOS application.
  • Now We need to add the App Store Id of the flutter application which can be located at the app’s URL.
  • We can also use makeshift app ID if our app is not published yet which can be replaced later.
  • We may need to add the Team ID which can be located at the Apple Member Centre under the provisioning profile.

Open XCode Following the Steps :

  • Signing & Capabilities: Turn On the associated domain by adding it to the list which looks like this firebasedynamiclicks.page.link .{URL Schema Created in the firebase console }.
Signing and Capabilities

Note: Make sure that your provisioning profile supports the associated domain’s capability.

  • Add the Identifier field as Bundle ID and URL Schema as your bundle ID which will look like com.flutterdevs.test.
Url Schemas

This can be Confirmed by opening the apple app site association file that will be hosted on the dynamic link’s domain. Like :-

https://firebasedynamiclinks.page.link/apple-app-site-association

If iOS Configuration is properly set up, then you will see a page displaying your app’s App Store ID and bundle ID . Like :-

{"applinks":{"apps":[],
"details":[{"appID":"1234567890.com.example.test","paths":["/*"]}]}}

There is No Additional Configuration Required to Use Dynamic links in an Android app.

Add the Firebase configuration file :

  • :. Click Download GoogleService-Info.plist to obtain your Firebase iOS config file (GoogleService-Info.plist).
  • Make sure the config file is not appended with additional characters, like (2).
  • :. Using XCode, move the file into the Runner/Runner directory of your Flutter app.

Adding Firebase Dynamic Links plugin :

Flutter is availed with Packages providing access to a wide range of services & APIs on each platform.

  1. From the root directory of your project, open the pubspec.yaml file and add the following package:
dependencies:
flutter:
sdk: flutter
# Add the dependency for the Firebase Core Flutter SDK
firebase_dynamic_links: ^0.5.0+11

2. Run flutter packages get.

This will enable your flutter project for adding of Firebase Dynamic Links.


Firebase Dynamic Links

:: Setting URL From Firebase Console :

  • Open Firebase console. Open Firebase Project in which you need to add Firebase Dynamic Links.
  • Configure App : (Android, iOS) in your Firebase project.
  • Grow Section will open up the Dynamic Links section
  • Now Click on Get Started button for creation of URL prefix
  • Create a Dynamic Link Containing Unique Domain Name of your App. For example: firebasedynamiclinks.page.link. Here, the domain name is suffixed with page.link.
  • Then, follow: Configure → Verify → Finish steps.

Create a dynamic link in the console

:: Open Firebase Console: Open Up the Project. Click on the New dynamic links button you will be redirected to some step defined for dynamic links creation :

  1. Set up your short URL link: add your custom prefix or you can also go with the default prefix provided and then click on go next
https://flutterdevs.page.link/create-first-post.

2. Set up your Dynamic Link : This will contain the valid URL link that will be navigated to up and will be used in our app.

3. Define link behaviour for iOS: Now we need to set define deep link behaviour specific in iOS : Select either from the Opening deep link in browser/ iOS app.

4. Define link behaviour for Android: Now we need to set define deep link behaviour specific in Android: Select either from the Opening deep link in browser/ Android app. Select your current firebase app we may also need to tell firebase what to do if the app is not installed in the device so that it can redirect to the defined google play store link for installation.

5. Campaign tracking, social tags, and advanced options (optional): This is where we can track social tags, campaign tracking for the deep link on various social media parameters.

Now you can create the link. After the link creation, you will see something like :

Create a Dynamic Link In Programming

This is a similar process to the process of dynamic links created in the console.

In the DynamicLinkService create a new function that returns a future called _createDynamicLink . In this function, we will define all the dynamic link parameters and return the Url.toString() .

class DynamicLinksService {
static Future<String> createDynamicLink(String parameter) async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
print(packageInfo.packageName);
String uriPrefix = "https://flutterdevs.page.link";

final DynamicLinkParameters parameters = DynamicLinkParameters(
uriPrefix: uriPrefix,
link: Uri.parse('https://example.com/$parameter'),
androidParameters: AndroidParameters(
packageName: packageInfo.packageName,
minimumVersion: 125,
),
iosParameters: IosParameters(
bundleId: packageInfo.packageName,
minimumVersion: packageInfo.version,
appStoreId: '123456789',
),
googleAnalyticsParameters: GoogleAnalyticsParameters(
campaign: 'example-promo',
medium: 'social',
source: 'orkut',
),
itunesConnectAnalyticsParameters: ItunesConnectAnalyticsParameters(
providerToken: '123456',
campaignToken: 'example-promo',
),
socialMetaTagParameters: SocialMetaTagParameters(
title: 'Example of a Dynamic Link',
description: 'This link works whether app is installed or not!',
imageUrl: Uri.parse(
"https://images.pexels.com/photos/3841338/pexels-photo-3841338.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260")),
);

// final Uri dynamicUrl = await parameters.buildUrl();
final ShortDynamicLink shortDynamicLink = await parameters.buildShortLink();
final Uri shortUrl = shortDynamicLink.shortUrl;
return shortUrl.toString();
}

static void initDynamicLinks() async {
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();

_handleDynamicLink(data);

FirebaseDynamicLinks.instance.onLink(
onSuccess: (PendingDynamicLinkData dynamicLink) async {
_handleDynamicLink(dynamicLink);
}, onError: (OnLinkErrorException e) async {
print('onLinkError');
print(e.message);
});
}

static _handleDynamicLink(PendingDynamicLinkData data) async {
final Uri deepLink = data?.link;

if (deepLink == null) {
return;
}
if (deepLink.pathSegments.contains('refer')) {
var title = deepLink.queryParameters['code'];
if (title != null) {
print("refercode=$title");


}
}
}
}

Check Out The Source Code :

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

Closing Thoughts

We have familiarised ourselves with Firebase Dynamic Links — Integration in apps. They can be embodied as a tool that can play an Influential role in Strengthening Up of Targeted Social Media Campaigns, Redirecting End User to Specific Context within the app, Migrating User to Try-In the App version of your web apps( & vice versa), Customising the Firebase dynamic Link Performance as per various platforms, Complete track of the link performance across various social media platform to Contemplate Future Campaign Strategies.

To find out more about Firebase Dynamic links :

heck out the documentation here and Give them a Try — Deep-link away.

References For the Blog :

Flutter – Beautiful native apps in record time
Flutter is Google’s UI toolkit for crafting beautiful, natively compiled applications for mobile, web, and desktop from…flutter.dev

Firebase
Send feedback Join us for Firebase Live , our new weekly web series, on Tuesdays from June 23rd – July 21st, for…firebase.google.com

firebase_dynamic_links | Flutter Package
A Flutter plugin to use the Google Dynamic Links for Firebase API. With Dynamic Links, your users get the best…pub.dev


🌸🌼🌸 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 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.