Google search engine
Home Blog Page 42

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.


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

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

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

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.


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

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.

Bluetooth Functionality in Flutter

Bluetooth is a type of functionality that provides access in and for other electronic devices, In the app world it is the most reliable wireless tool which provides access to other devices and it also gives free cost service because it is an inbuilt feature of the most mobile and other electronic devices. However, now some devices like mobile phones are out there without Bluetooth because their developers prefer to rely on the internet instead of Bluetooth for any kind of connectivity. In this era of digitalization when the internet is cheaper than food and every electronic device is becoming internet processed device but Bluetooth is still reliable functionality for connectivity.

In this example, we are going to use flutter_blue package to implement Bluetooth functionality in our app

Implementation

Adding FlutterBlue package into in the Flutter. First, you need to add this package in pubspec.yaml

flutter_blue:

Importing FlutterBlue Dependency package into the flutter Dart Code:

import 'package:flutter_blue/flutter_blue.dart';

Now when you are using this flutter plugin then you need to access it from the library and for this, you need to create an instance of it, so we do this by writing this code

FlutterBlue flutterBlueInstance  = FlutterBlue.instance;

there are different parts while you are making a connection with the device and theses steps are scanning device, discovering device, connecting device, reading, and writing characteristic and also implementing notification setting into your app.

for all these processes there is a set of code and it is a kind of boilerplate because you need to write exactly as it is for different steps mentioned above

so let’s see how can we implement these steps in our app

Scanning Device

// this line will start scanning bluetooth devices
var scanDevices = flutterBlue.scan().listen((scanResult) {
});
// this line will stop scanning bluetooth devices
scanDevices.cancel();

after scanning all the devices you need to connect your device with the scanned device and you can do this by using this

Connect to a Bluetooth device

// need to create connection for device
var deviceConnection = flutterBlue.connect(device).listen((s) {
if(scan == BluetoothDeviceState.connected) {
// now device is connected you can perform your action
}
});
// it will disconnect your device 
deviceConnection.cancel();

Searching Bluetooth services

List<BluetoothService> services = await device.discoverServices();
services.forEach((service) {
// perform action with services
});

Reading and writing characteristics

// Reads all characteristics
var characteristics = service.characteristics;
for(BluetoothCharacteristic c in characteristics) {
List<int> value = await device.readCharacteristic(c);
print(value);
}
// Writes to a characteristic
await device.writeCharacteristic(c, [0x12, 0x34])

Reading and writing descriptors

// Reads all descriptors
var descriptors = characteristic.descriptors;
for(BluetoothDescriptor d in descriptors) {
List<int> value = await device.readDescriptor(d);
print(value);
}
// Writes to a descriptor
await device.writeDescriptor(d, [0x12, 0x34])

Setting notifications

await device.setNotifyValue(characteristic, true);
device.onValueChanged(characteristic).listen((value) {
// do something with new value
});

so these are one of the key methods and by using these you can make your app rich in functionality.

This Flutter blue plugin is having some functionalities which are platform-specific for example

Read the MTU and request a larger size

final mtu = await device.mtu.first;
await device.requestMtu(512);

Note that iOS will not allow requests of MTU size, and will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)

Flutter_blue has some references these references indicate which functionality is available for Android, iOS, or for both and it has been clearly instructed by the Flutter_blue team so before going over implementation you must go through this section.

while implementing all these methods you must set your minimum SDK version 19

References





Scanning for service UUID’s doesn’t return any results

One thing which you need to focus on the device is advertising which type of service UUID’s support, there are some advertisement packets like UUID 16 bit and UUID 128 bit.

here in the given images, you can see how at first step device is scanning all available devices and how it is showing all its notification.

you can find the full source code here

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

Conclusion

This Flutter_blue package provides a good milieu to implement all your required functionalities whether it is connecting with mobile devices, electronic devices, or IoT devices, It fits in all works for all and is compatible with all. You will get an awesome experience with its implementation.

Note: In some blogs, it has been written that you need to make some changes to info.plist(for iOS) and in the manifest file(for android) but you don’t need to do that. It works fine with any changes in these files.


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

Implementing Google-Maps in Flutter

What we will build ::

Before starting the blog let me tell you what you can learn from this blog/article:-

  1. You learn how to implement Google-Maps in your flutter app using flutter_google_maps package.
  2. How to fetch the live Geo-coordinates of the user location using location package.
  3. How to implement light and dark mode in google maps.
  4. How to move the maps camera bound form one geo-coord to another.
  5. You will learn how to add markers, polygons, directions, information about any geo-coord , displaying a dialog box containing information about the geo-coord ,clear polygon, direction, markers, etc.
  6. You will learn how to implement functionality into your flutter app, how to work with multiple packages.

Demo of our app: —


Introduction

Google Maps is a mapping service developed by Google. This tool provides us a lot of features that we can use in our daily lifestyle. Google Maps is highly effective and fast, provides us a lot of information in realtime.

Key Features:

  • :: Provide realtime information about traffic
  • :: Provide all possible routes between two points
  • :: Calculate accurate distance between two points
  • :: Provides us additional information about the location in which we are interested
  • :: Stores our travel history
  • :: Controls two-third of the online navigation market
  • :: Shopping app and websites actively uses maps to fasten their delivery process
  • :: Maps is highly used as a marketing tool

Table of content :

  1. Setting up project
  2. Install Packages
  3. Initialize Google maps
  4. Get the live location
  5. Displaying the google_map on screen
  6. Adding Widgets to implement functionality
  7. GitHub Link

Setting up Project :

  1. Follow the steps give in the documentation:

flutter_google_maps | Flutter Package
A Flutter plugin for integrating Google Maps in iOS, Android, and Web applications. It is a wrapper of…pub.dev

Do not forget to specify the API key in your android/app/src/main/AndroidManifest.xml file.

2. Add the location permission into the AndroidManifest.xml manifest outside of the application tag.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

3. Update your build.gradle file dependencies to this

dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.2.0'
}

4. minSdkVersion 21

Note: Last Two steps are used for location: package

Installing Package:

Install the following package:

flutter_google_maps | Flutter Package
A Flutter plugin for integrating Google Maps in iOS, Android, and Web applications. It is a wrapper of…pub.dev

location | Flutter Package
This plugin for Flutter handles getting a location on Android and iOS. It also provides callbacks when location is…pub.dev

hawk_fab_menu | Flutter Package
A floating action button menu that will pop up small fabs on top Add dependency in pubspec.yaml: hawk_fab_menu: ^0.2.2…pub.dev

Import package :

import 'package:flutter_google_maps/flutter_google_maps.dart';
import 'package:hawk_fab_menu/hawk_fab_menu.dart';
import 'package:location/location.dart';

Initialize Google maps :

Inside the main function, intit("your key") method is used to initialize the Google Map API.

void main() {
GoogleMap.init('your key');
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}

Get the live location:

To get the live location we will use the location package.

location | Flutter Package
This plugin for Flutter handles getting a location on Android and iOS. It also provides callbacks when the location is…pub.dev

getLocation() is a method used to get the live latitude and longitude . longitude , latitude are two variables used to store the geo-coordinates. getLocation is a method inside the Location() class which provides us the geo-coordinates. userLocation is used to provide the access the longitude ,latitude . We have used the try and catch method to display the error message if there is an error.

Future getLocation() async {
try {
var userLocation = await Location().getLocation();
setState(() {
longitude = userLocation.longitude;
latitude = userLocation.latitude;
});
} on Exception catch (e) {
print('Could not get location: ${e.toString()}');
}
}
double latitude;
double longitude;

Initializing the getLocation()

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

Displaying the google_map on screen:

initializing Global keys

final _scaffoldKey = GlobalKey<ScaffoldState>();
final key = GlobalKey<GoogleMapStateBase>();

google map

flutter_google_maps provides us GoogleMap() widgets to display the map view on the screen. This widget has lots of properties that can be used to customize the map view. markers is the list of Marker() , used to display the markers on the screen. initialZoom is the initial zoom of the maps camera. initialPosition is the initial position of the map. It takes GeoCoord() widget. mapType specify the type of map type. mapStyle is the color combination of the map. Here I have added a functionality when the user will click on the map at any position the marker will we added to the map at that particular location.

onTap: (geo) {
setState(() {
longitude = geo.longitude;
latitude = geo.latitude;
});
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text(geo?.toString()),
duration: const Duration(seconds: 2),
));
GoogleMap.of(key)
.addMarkerRaw(GeoCoord(latitude, longitude));
polygon.add(GeoCoord(latitude, longitude));
},

To do this we will need the coordinates of the point at which the user will click, so need to change the latitude ,longitude . Whenever the user clicks the screen snakeBar is also displayed that shows the values of geo-coord. Also to display the polygon we need some points that is why we used polygon.add(GeoCoord(latitude, longitude)); here polygon is the list of GeoCoord . To display the marker, GoogleMap class provides us addMarkerRaw() method.

GoogleMap(
key: key,
markers: {
Marker(
GeoCoord(latitude, longitude),
),
},
initialZoom: 12,
initialPosition: GeoCoord(latitude, longitude),
mapType: _mapType == null ? MapType.roadmap : _mapType,
mapStyle: _mapStyle,
interactive: true,
onTap: (geo) {
setState(() {
longitude = geo.longitude;
latitude = geo.latitude;
});
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text(geo?.toString()),
duration: const Duration(seconds: 2),
));
GoogleMap.of(key)
.addMarkerRaw(GeoCoord(latitude, longitude));
polygon.add(GeoCoord(latitude, longitude));
},
mobilePreferences: const MobileMapPreferences(
trafficEnabled: true, zoomControlsEnabled: false),
webPreferences: WebMapPreferences(
fullscreenControl: true,
zoomControl: true,
),
),

Adding Widgets to implement functionality :

Screen Widgets

Changing the style of the map:

To change the style of the map I have used a CircleAvatar on the left of the screen, on tapping it displays a Dialog Box that shows the list of the type of the style of the map. On pressing any style it will change the map style.

List<MapType> mapType = [
MapType.hybrid,
MapType.roadmap,
MapType.satellite,
MapType.terrain,
MapType.none,
];
MapType _mapType ;
List<String> mapTypeName = [
"Hybrid",
"Roadmap",
"Satellite",
"Terrain",
"None"
];

The above variables are used to implement the functionality.

Positioned(
top: 15,
right: 20,
child: InkWell(
onTap: () {
showDialog(
context: context,
builder: (_) {
return AlertDialog(
title: Text("Map Style"),
content: Container(
height: mapType.length * 64.0,
width: 100,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Card(
child: ListTile(
title: Text(mapTypeName[index]),
onTap: () {
setState(() {
_mapType = mapType[index];
});
Navigator.of(context).pop();
},
),
);
},
itemCount: mapType.length,
),
),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text("CANCEL"),
)
],
);
});
},
child: CircleAvatar(
radius: 25,
backgroundColor: Colors.white,
child: Icon(
Icons.filter_none,
color: Colors.blue,
),
),
))

Edit menu

To display the edit menu I have used an animated floatingActionButton .

body: HawkFabMenu(
items: [
HawkFabMenuItem(
label: 'Add Polygon',
ontap: () {
},
icon: Icon(
Icons.crop_square,
),
),
HawkFabMenuItem(
label: 'Info Demo',
ontap: () {
},
icon: Icon(Icons.pin_drop),
),
HawkFabMenuItem(
label: 'Directions',
ontap: () {
},
icon: Icon(Icons.directions),
),
],
body: _body
],
),
));

Add Polygon :

addPolygon() is a method that makes id and a List of GeoCoord() that connect each other to display a polygon on the map screen. editPolygon is used to edit the polygon.

ontap: () {
if (!_polygonAdded) {
GoogleMap.of(key).addPolygon(
'1',
polygon,
onTap: (polygonId) async {
await showDialog(
context: context,
builder: (context) => AlertDialog(
content: Text(
'This dialog was opened by tapping on the polygon!\n'
'Polygon ID is $polygonId',
),
actions: <Widget>[
FlatButton(
onPressed: Navigator.of(context).pop,
child: Text('CLOSE'),
),
],
),
);
},
);
} else {
GoogleMap.of(key).editPolygon(
'1',
polygon,
fillColor: Colors.purple,
strokeColor: Colors.purple,
);
}

setState(() => _polygonAdded = true);
},

Information Demo :

ontap: () {
GoogleMap.of(key).addMarkerRaw(
GeoCoord(latitude, longitude),
info: 'test info',
onInfoWindowTap: () async {
await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text("Palace Info..."),
content:
Text('Latitude:$latitude\nLongitude:$longitude'),
actions: <Widget>[
FlatButton(
onPressed: Navigator.of(context).pop,
child: Text('CLOSE'),
),
],
),
);
},
);

},

Directions :

ontap: () {
GoogleMap.of(key).addDirection(
'San Francisco, CA',
'San Jose, CA',
startLabel: '1',
startInfo: 'San Francisco, CA',
endIcon:
'https://cdn0.iconfinder.com/data/icons/map-markers-2-1/512/xxx018-512.png',
endInfo: 'San Jose, CA',
);
},

Drawer

Light and dark mode :

To change the theme of the map GoogleMap class provides us changeMapStyle() method to change the style of the map. _darkMapStyle is a bool variable used to change the state of text, icon, and map style.

 ListTile(
leading: Icon(
Icons.wb_sunny,
color: _darkMapStyle ? Colors.deepOrange : Colors.black,
),
onTap: () {
Navigator.of(context).pop();
if (_darkMapStyle) {
GoogleMap.of(key).changeMapStyle(null);
_mapStyle = null;
} else {
GoogleMap.of(key).changeMapStyle(darkMapStyle);
_mapStyle = darkMapStyle;
}

setState(() => _darkMapStyle = !_darkMapStyle);
},
title:
Text(_darkMapStyle ? "Enable Light Mode" : "Enable Dark Mode"),
),

Move Camera Bound :

moveCameraBounds is a method used to move the maps camera from one

geo-coord to anothergeo-coord . It takes GeoCoordBounds() that is used to specify thenortheast, and southwest GeoCoord() . We are also displaying a marker on the specified location.

ListTile(
title: Text("Move camera bound"),
leading: Icon(
Icons.camera_enhance,
color: Colors.red,
),
onTap: () {
Navigator.of(context).pop();
final bounds = GeoCoordBounds(
northeast: GeoCoord(34.021307, -117.432317),
southwest: GeoCoord(33.835745, -117.712785),
);
GoogleMap.of(key).moveCameraBounds(bounds);
GoogleMap.of(key).addMarkerRaw(
GeoCoord(
(bounds.northeast.latitude + bounds.southwest.latitude) / 2,
(bounds.northeast.longitude + bounds.southwest.longitude) / 2,
),
onTap: (markerId) async {
await showDialog(
context: context,
builder: (context) => AlertDialog(
content: Text(
'This dialog was opened by tapping on the marker!\n'
'Marker ID is $markerId',
),
actions: <Widget>[
FlatButton(
onPressed: Navigator.of(context).pop,
child: Text('CLOSE'),
),
],
),
);
},
);
},
),

Clear Polygon :

clearPolygons() method clear all the drawn polygon on the map screen. polygon list is set to [] so that it also clear when all polygons are cleared.

ListTile(
title: Text("Clear Polygons"),
leading: Icon(
Icons.crop_square,
color: Colors.blue,
),
onTap: () {
GoogleMap.of(key).clearPolygons();
Navigator.of(context).pop();
setState(() {
polygon = [];
_polygonAdded = false;
});
},
),

Clear Marker :

clearMarker() method is used to clear all the markers from the maps.

ListTile(
title: Text("Clear Markers"),
leading: Icon(
Icons.location_off,
color: Colors.green,
),
onTap: () {
GoogleMap.of(key).clearMarkers();
Navigator.of(context).pop();
},
),

Clear Direction :

clearDirection()is used to clear all the directions from the map.

ListTile(
title: Text("Clear Directions"),
leading: Icon(
Icons.directions,
color: Colors.orangeAccent,
),
onTap: () {
GoogleMap.of(key).clearDirections();
Navigator.of(context).pop();
},
),

Github Link

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


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

www.flutterdevs.com

Push Notifications vs. In-App Notification— An Approach to Customer Engagement

0

Targeted marketing is the most effective with a multi-channel approach, and the best mobile campaigns often use a combination of mobile push notifications and in-app messaging. That’s because the complementary channels each offer their own advantages and disadvantages.

Mobile is personal. It’s more tailored to user interests than any other before it, which means app marketing has to be less about blatant agenda pushing and more about targeted engagement.

App messaging techniques are a key part of this strategy, working to reach the user at the right time, with the right content, to engage him or her further. The two most important are push notifications and in-app messages. So, what’s the difference when it comes to your app marketing?

Push notifications are probably what comes to mind when you think of mobile app messaging; most marketers use it often because it’s an easy-to-implement industry standard. But since 2014, in-app notification has become much more widespread in mobile marketing. Used to highlight new features, showcase special offers, onboard new users, and more, in-app is a powerful tool to create more targeted, purposeful user sessions. Our research has shown that apps who use it see a 27% increase in app launches and a 3.5x increase in retention.

But when do you use push notification, and when is an in-app message the right call? Let’s discuss it!

A Quick Introduction

The Difference Between Push Notifications and In-App Notification

The two most important ways to deliver app messaging campaigns are push notifications and in-app messages. So, what’s the difference between in-app notification and push notifications?

What are Push Notifications?

Push Notifications allow you to deliver messages to the user’s home screen. It’s like an SMS message, but coming from an app instead of your mom. Traditionally, push notifications were solely text, but now, rich push notifications let mobile marketers include text as well as images, video, and sound. Great for prompting immediate interaction and engaging users not currently active in your app, push messaging directs attention to the desired action. Users who opt-in for push notifications are a high-value demographic, those users tend to engage with your app on a regular basis 88% more. But often, push messaging comes down to three key considerations:

  • Content
  • Frequency
  • Timing

In-App Messaging

Recently, in-app notification has become more common in mobile marketing. It can be used to draw attention to new features, highlight special offers, better onboard new app users, and much more. What’s more, in-app messages can deliver rich content like images and video too. Overall, in-app notification is a powerful tool to create more targeted user sessions. There are stats floating around the industry that say those who use in-app notification see around a 30% increase in uptake of app launches and a massive 4 times increase in app retention.

When To Use Push Notifications?

Push notifications are great for prompting immediate interaction and engaging app users who are not currently active in the app. A weather app sends push-notifications of severe weather, for example. Social media users receive notifications that someone has sent them a message. You can also consider this approach in these cases:

Transactional Updates

Notifications about order placements, delivery status updates, abandoned carts, payment success/failure, etc. are best served as push notifications as they need the users’ immediate attention.

Deliver Time-Sensitive Deals & Offer

Time-sensitive alerts and reminders are best sent via push notification, as users aren’t always in the app when important news needs to be relayed. For appointment reminders, low-funds account balance warnings, and last-minute travel changes, users need to be notified via the fastest channel possible.

App Related Updates

Whenever there are any updates in your app or new versions of the app, feature upgrades, service enhancements, etc, these can be communicated to the users with timely mobile push notifications. This conveys a straight message to the users that you are constantly improving the overall app usage experience.

Nudge Users

Push notifications are the best tools for nudging the app abandoners. With precision push notification service, brands can woo users back with customized messaging based on a variety of factors: a number of days inactive, best re-engagement times, response to previous re-engagement attempts, and previous in-app behavior.

When To Use In-App Messages?

You can use in-app messages to:

Help Users During the Onboarding process

With the advancements in the technology and creativity of the people, apps have become tricky and have complex features. Because of this, a process of onboarding has become fairly popular among the app makers and especially when there are changes in the UI. For example, many brands use in-app notification as part of its onboarding process or for walking users through design changes.

Offer Recommendations

There is a huge opportunity for cross-selling and upselling products when the user is active on the app. Giving smart recommendations based on the user’s search or buying history can be very beneficial for sales growth and customer life-cycle. In-app messages can do this job seamlessly.

Share App features & updates

Sometimes, users just forget about a feature. Sending an in-app message to point out the feature can give users more value out of the application.

Gather Feedback

Getting users’ feedback is usually complex. In-app messages for feedback sent right after a user experiences an update or beta feature can give brands some of the highest percentages of responses and the best feedback.

What’s Best For You?

The decision of what suits the best for your app depends a lot on your marketing and customer engagement strategies. How you plan to engage your users and increase retention.

Talking about Push Notifications, often, the decision of using push messaging comes down to the content, frequency, and timing of the messaging. If you get all three right then push messaging drives lapsed users back into your app and brings awareness to your mobile marketing campaigns. But wait, don’t misuse it. Push notification can be a strong tool to gain user attention but can also be the biggest reason for the app being uninstalled.

Note, Push Notifications can be irritating for the user and ineffective if they lack context or purpose. Overdo push notifications and you will risk an app uninstall.

When it comes to In-App Messaging, Due to its tailored style of triggering based on user interaction, it creates a more seamless progression from an app user’s initial session to the desired conversion. If it’s done well, in-app notification should feel like a natural part of the app.

But again, just like push notification, if in-app messages are not done right it can end up feeling too much advertising. Also, if the messages are not sent in real-time they can present irrelevant content.

The gist of it all comes down to one thing, that push notifications and in-app notification should go hand-in-hand to help you run highly efficient marketing campaigns. Smart marketing always knows the ways to combine the power of these two to get the maximum out of the app.

Wrapping Up

Both push notifications and in-app notifications are the next waves of communication for businesses. Research shows 7.33 billion people worldwide will own a smartphone by 2023, which means businesses must embrace mobile marketing methods to ensure a continued connection between brands and consumers.

At the end of the day, push notifications and in-app notifications each provide an invaluable opportunity to connect and re-engage users with your app. And, when done well, creative strategies can help boost app engagement and revenue.


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.