Google search engine
Home Blog Page 57

Explore ValueListenableBuilder in Flutter

0

Introduction

In this blog, we shall explore how to use the ValueListenableBuilder widget. It is an amazing widget. It builds the widget every time the valueListenable value changes. Its values remain synced with there listeners i.e. whenever the values change the ValueListenable listen to it. It updates the UI without using setState() or any other state management technique.


Properties:

  1. valueListenable:
  2. builder:
  3. child:

These are the three properties of ValueListenableBuilder. bulder build widget depending upon the valueListenable value. valueListenable is an instance of ValueNotifier . child property is optional, it can be null if valueListenable value entirely depends upon the builder widget.

Example:

  • Creating a AppValueNotifier class.
class AppValueNotifiier{}
  • ValueNotifier
class AppValueNotifiier{
ValueNotifier valueNotifier = ValueNotifier(0);
}
  • Creating an increment function
class AppValueNotifier{
ValueNotifier valueNotifier = ValueNotifier(0);
  void incrementNotifier() {
valueNotifier.value++;
}
}
  • Creating an object of AppValueNotifier
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  AppValueNotifier appValueNotifier = AppValueNotifier();

@override
Widget build(BuildContext context) {
return Container();
}
}
  • Initializing ValueListenableBuilder
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
AppValueNotifier appValueNotifier = AppValueNotifier();

@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: appValueNotifier.valueNotifier,
builder: (context, value, child) {
return Text(value.toString());
},
);
}
}
  • Using increment function
Scaffold(
body: ValueListenableBuilder(
valueListenable: appValueNotifier.valueNotifier,
builder: (context, value, child) {
return Text(value.toString());
},
),
floatingActionButton: FloatingActionButton(
onPressed: () {
appValueNotifier.incrementNotifier();
},
),
);

Using multiple ValueListenableBuilder, listening more than one value:

  • To use multiple ValueListenableBuilder , we will create the following ValueNotifier:
ValueNotifier incrementValueNotifier = ValueNotifier(10);
ValueNotifier decrementValueNotifier = ValueNotifier(0);
ValueNotifier colorValueNotifier = ValueNotifier(false);
ValueNotifier subtractValueNotifier = ValueNotifier(0);
  • Creating multiple function to perform various action:
void decrementNotifier() {
decrementValueNotifier.value = decrementValueNotifier.value - 3;
}

void colorNotifier() {
colorValueNotifier.value = !colorValueNotifier.value;
}

void operation() {
subtractValueNotifier.value =
incrementValueNotifier.value + decrementValueNotifier.value;
}

void incrementNotifier() {
incrementValueNotifier.value++;
}

We have created two valueNotifier for increment and decrement, one for color, and one for subtraction operation. We will change the color of the container, the increment and decrement counters, and the substation of both the counters.

  • Nested ValueListenableBuilder
ValueListenableBuilder(
valueListenable: appValueNotifier.incrementValueNotifier,
builder: (context, increment, _) => ValueListenableBuilder(
valueListenable: appValueNotifier.decrementValueNotifier,
builder: (context, decrement, _) => ValueListenableBuilder(
valueListenable: appValueNotifier.colorValueNotifier,
builder: (context, color, _) => ValueListenableBuilder(
valueListenable:
appValueNotifier.subtractValueNotifier,
builder: (context, subtract, _) => Container(
width: 100,
height: 30,
color: color ? Colors.red : Colors.orangeAccent,
child: Center(
child:
Text("$increment $decrement = $subtract"),
)))))))
  • Changing floatingActionButton
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {
appValueNotifier.incrementNotifier();
appValueNotifier.decrementNotifier();
appValueNotifier.colorNotifier();
appValueNotifier.operation();
}),
  • disposing all value notifier

We must dispose valueNotifier as ValueNotifier is a disposable value. Also, prevent app memory loss.

@override
void dispose() {
appValueNotifier.subtractValueNotifier.dispose();
appValueNotifier.incrementValueNotifier.dispose();
appValueNotifier.decrementValueNotifier.dispose();
appValueNotifier.colorValueNotifier.dispose();
super.dispose();
}

Better real app example to use ValueListenableBuilder:

Building a Secured Flutter Application
Learn to Disable Screen Capturing & Video Recording And Enabling Fingerprint Authentication every timemedium.com


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.

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


From Our Parent Company Aeologic

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

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

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

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

Related: Explore Dart String Interpolation

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

Collections in Dart

0

Introduction

Dart supports four types of collection with full-featured API. List, Set, Queue, Map are the four types of collection in Dart programming language. List, Set, Queue are iterable while Maps are not. Iterable collections can be changed i.e. their items can be modified, add, remove, can be accessed sequentially. The map doesn’t extend iterable.


Iterable

Iterable is an extract class, it can’t de instantiate directly.

An Iterable of string and int

void main() {
Iterable<int> var1 = [1,2,3,4];
Iterable<String> var2 = ['a','b','c','d'];
}

The difference with List and Iterable is that that element in the list can be accessed with their index value using [] operator while in Iterable value can’t be accessed using [] operator.

void main() {
Iterable<int> var1 = [1,2,3,4];
Iterable<String> var2 = ['a','b','c','d'];
print(var1[1]);
}

If we run the above program. We get the operator error.

Error compiling to JavaScript:
main.dart:4:13:
Error: The operator '[]' isn't defined for the class 'Iterable<int>'.
- 'Iterable' is from 'dart:core'.
print(var1[1]);
^
Error: Compilation failed.

Correct program:

void main() {
Iterable<int> var1 = [1,2,3,4];
Iterable<String> var2 = ['a','b','c','d'];
print(var1.elementAt(1));
}

Output: 2

Using for loop to print element of iterable

void main() {
Iterable<int> var1 = [1, 2, 3, 4];
for (var element in var1) {
print(element);
}
}

Performing few operations:

void main() {
Iterable<int> var1 = [1, 2, 3, 4];
print(var1.first);
print(var1.last);
print(var1.length);
print(var1.contains(1));
print(var1.skip(1));
print(var1.single);

}

OutPut:

1
4
4
true
(2, 3, 4)
Uncaught Error: Bad state: Too many elements

firstreturn the first element, last return the last element, length return the length of iterable, contains(1) return the element at position 1, skip(1) skip the element at position 1, single return the element if iterable has only one element. Throw this error if it has more than one element or empty Uncaught Error: Bad state: Too many elements .

List

A list is an array of elements arranged in an ordered sequence.

There are two types of List:

  1. Fixed-Length List
  2. Growable List

Fixed-Length List is a list that can’t be changed once initialized whereas the Growable list is dynamic in nature.

Fixed-length List

  • Creating a Fixed-length List
void main() {
List<String> list = List(5);
}

The indexing value start with 0 and end with listOfLength-1 . So for the list index values will be 0 to 4 .

  • Here the list is empty, so let’s assign the value for each index:
void main() {
List<String> list = List(5);
list[0] = 'a';
list[1] = 'b';
list[2] = 'c';
list[3] = 'd';
list[4] = 'e';
}
  • Printing the values:
print(list[1]);
  • Updating the value:
void main() {
List<String> list = List(5);
list[0] = 'a';
list[1] = 'b';
list[2] = 'c';
list[3] = 'd';
list[4] = 'e';
list[0] = 'm';
print(list[0]);
}

Output:m .

Growable List

  • Growable List example:
void main() {
List<String> list = List();
}
  • Inserting elements in List:
void main() {
List<String> list = List();
list.add('a');
list.add('b');
list.add('c');
}
  • Updating element:
void main() {
List<String> list = List();
list.add('a');
list.add('b');
list.add('c');
list[1]= 'm';
}

Set

A set is an unordered collection of values. We can’t get the values by their index values as they are unordered. Values in set are unique i.e. they can’t be repeated.

  • Creating a Set using a constructor:
void main() {
Set<int> set = Set();
}
  • Creating a Set using List
void main() {
List<int> list = [1, 2, 3, 4];
Set<int> set = Set.from(list);
}
  • Inserting elements in Set
void main() {
List<int> list = [1, 2, 3, 4];
Set<int> set = Set.from(list);
set.add(5);
set.add(6);
}

Maps

Maps is an unordered pair of key and values. The keys of the map must unique, values can be the same. Map is also called dictionary or hash .The size of a map is not fixed, we can add, delete edit the values of the map. The size of the map depends upon the number of elements in the map. The values in the map can only be accessed through the key name, not by the index values.

  • Creating a map using constructor:
void main() {
Map<String, int> map = Map();
}

Here we have created a map named map whose key type is String and value type is int .

  • Adding a value and printing the map:
void main() {
Map<String, int> map = Map();
map['number'] = 1;
print(map);
}

Output:{number: 1}

Accessing value by its key : print(map[‘number’]); .

Printing all keys and values of the map:

void main() {
Map<String, int> map = Map();
map['number1'] = 1;
map['number2'] = 2;
map['number3'] = 3;
for (String keys in map.keys) {
print(keys);
}
for (int values in map.values) {
print(values);
}
}

Output:

number1
number2
number3
1
2
3

Printing Key-Value pair:

map.forEach((key, value) {
print("$key:$value");
});

OutPut:

number1:1
number2:2
number3:3

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.

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


From Our Parent Company Aeologic

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

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

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

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

Related: Metadata Annotations in Dart

Related: Sum Of a List Of Numbers In Dart

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

Important Dart Concepts In Flutter

0

In this blog, we shall learn about various Null-aware operators, where to use const keyword, async, and await. Dart is a powerful language that provides us, various special operators, keyword. Operators are the special characters that are used to perform various operations on the operants. There are four null-aware operators that are used to handle the null values. const keyword is used to reduce the rebuild of const object every time.


Null- aware Operators

Operators that deals with values that might be null during runtime are called Null-aware Operators.

  • ?. operator

This operator is used when you call a method on an object if that object is not null.

Eg. If we have a String value , we want to return null if it is null and if not then value.toLowerCase() , then we can use value?.toLowerCase() .

It is equivalent to value ==null?null:value.toLowerCase() .

  • ??= operators

It is called a null-aware assignment.

void main() {
String string;
//if (string == null) string = 'Hi!';
string ??= 'Hi!';
print(string);
}
  • ?? operators : It is a null operator.
void main() {
String string = "Hi!";
print(string ?? string??2);
}

Output: Hi!

void main() {
String string;
print(string ?? string??2);
}

Output: 2

In the first program, the output is Hi! while in the second program the output is 2 . As we can see in the first program the value of the string is not null that is why it has returned the left part of the statement string ?? string??2 . While in the second program string is null hence it has returned the right part of the statement i.e. 2

  • … operator

This operator is amazing. It adds a list that is not null with the other list of the same type.

void main() {
List<int> list = [1,2,3];
List<int> list1 = [4,5,6];
List<int> finalList = [0,...list,...list1];
print(finalList);
}

Output:[0, 1, 2, 3, 4, 5, 6] .

Use of const keyword

const keyword in dart is highly effective to use as

  • It increases the performance of our app.
  • Reduce CPU load.
  • Allocate only one memory space.

Using const keyword while construction an objectconst Text("Hi!"), while creating a collection const [3,4,2,5] .

If we use const like this, it will work absolutely fine.

void main() {
const int value = 2;
const int _value = 3;
const int result = value + _value;
print(result);
}

But if we use const DateTime.now() , this will not work as it changes and it needs to be rebuilt every time the user opens the app. We will get the following error.

The constructor being called isn’t a const constructor. Try removing ‘const’ from the constructor invocation.

  • : A const constructor can’t be assigned for a class.
  • : If you repeat the const object in the same class it will reuse the same object created for the first time.
  • : The const objects are frozen and completely Immutable.
  • : Const variables are implicitly final i.e. Compile-time constant.

What is async and await ?

These two keywords are highly useful for updating our UI while processing our data. Example if we use authentication in our app then while signing up, signing in, logout there is a small-time delay while performing these operation, so it would be nice if we can display a loading spinner while these operation gets executed.

For this purpose, we can use async and await keyword in our authentication code and we can build our logic for displaying our logic.

While creating a function for authentication make that function asynchronous by using the async keywordauth()async{} . await is used to show up the Circular Progress Indicator until the Code Execution is Completed.

auth()async{
//set the loading spinner state var signIn = await authentication();
//reset the state of loading spinner
}

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.

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


From Our Parent Company Aeologic

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

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

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

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

Related: Metadata Annotations in Dart

Related: Sum Of a List Of Numbers In Dart

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

Flutter Animation Guide for Beginners 2026

0

Introduction To Topic :

Implementing animation into your app might be the best idea to make your app more smooth, polished, slick, and nice. In flutter using animation is quite simple.

In general, flutter provides us two types of animation — Tween animation and Physics-based animation. Tween animation is used if we want to animate a widget with a fixed start and finish. While Physics-based animation relies on the user interaction.


Table of content :

Tweens

Animation curves

Ticker Providers

AnimationController


Tweens

Tween is an object that takes a start value and an end value. Value can be anything like color, opacity. We can use Tween to change the color of appBar from blue to pink or any other colors. The change in color is handled by the Animation library. The Tween value lies between 0.0 to 1.0.

Tween( begin: 0.0, end: 1.0, );

Animation curves

Animation curves are used to define to flow rate of animation. It fixes the path of animation, allows the animation to speed up or slow down at a specific point. Flutter provides us Curves class. The default curve is linear. Curves class is packed with a variety of curves path eg. easeIn, elasticIn etc.

Ticker Providers

Ticker can be used by the object that needs to be notified every time the frame changes triggers. TickerProviderclass provides a ticker for the widget.

Using TickerProvider :

class MyAnimation extends StatefulWidget {
@override
_MyAnimationState createState() => _MyAnimationState();
}
class _MyAnimationState extends State<MyAnimation>
with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Container();
}
}

AnimationController

By the name, we can understand that it’s a controller that controls the animation. This object has so many properties. The object must be initialised inside the initState() of the class.

class MyAnimation extends StatefulWidget {
@override
_MyAnimationState createState() => _MyAnimationState();
}
class _MyAnimationState extends State<MyAnimation>
with TickerProviderStateMixin {
AnimationController _animationController;

@override
void initState() {
_animation = AnimationController(
vsync: this,
duration: Duration(
seconds: 1,
),
);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container();
}
}

Creating a color animation:

class MyAnimation extends StatefulWidget {
@override
_MyAnimationState createState() => _MyAnimationState();
}
class _MyAnimationState extends State<MyAnimation>
with TickerProviderStateMixin {
AnimationController _animationController;
Animation _animation;
@override
void initState() {
_animationController = AnimationController(
vsync: this,
duration: Duration(
seconds: 1,
),
);
_animation = ColorTween(begin: Colors.deepOrangeAccent, end: Colors.green)
.animate(_animationController);
    _animationController.forward();
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 50,
color: _animation.value,
); }
}

This is an example to create your first animation. Here I have just used all the above topics. So let me summarize the whole scenario.The first step is to add TickerProviderStateMixin to the state class of StatefulWidget. Then create a AnimationController that we will use to perform various actions with the animation. Then you need to initialize a AnimationController object that is use to pass the current class context and duration and any more. To pass the Tween create a Animation and pass ColorTween object (inside the initState() method) that takes the start and end color that we need to change while animating the container colors. Then add animate() ,this allows Tweens to be chained before obtaining an Animation. Now forward that AnimationController , so that it can get started with animation _animationController.forward(); .

Adding curve in animation:

CurveAnimation() creates a curved animation. It takes a parent, curve arguments. parent takes a AnimationController and curve takes a Curve .

_animation = ColorTween(begin: Colors.red, end: Colors.green)
.animate(CurvedAnimation(
parent: _animationController,
curve: Curves.bounceIn,
));

Now you are ready to go to implement animation into your apps. Thanks…


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.

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


From Our Parent Company Aeologic

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

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

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

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

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

Headless CMS In Flutter

0

HI, everyone I am glad to be back with another topic, this time i will be covering Headless CMS with flutter.

So, What is Headless CMS, or rather lets start from what is CMS itself.

CMS stands for Content Management System. It helps by controlling what content to be shown to user, content mostly is managed by people who don’t have much knowledge about the code, so for them it might look like just a basic form where they put in data, the data get stored in Database and then our app extracts that data from Database and displays to user. It is useful because all the content can be managed separately and would not need to be coded in manually, so that even for a smallest change you won’t have to waste time to search where you put in that particular string and then change it.


Now, coming to Headless CMS

The “Headless” is the new approach towards CMS whereas in the traditional CMS it was mostly coupled with a web page but, this new approach helps to widen that horizon and makes it so that content can be displayed on any device of users choice.

The devices are called “Heads” and since there are many devices so that means there is not a single fixed head.

This approach is better and an overall improvement over traditional CMS.

The way it works is that it provides us an API for all of our data and if we like we can use that directly in our project to show changes to user, Hence why this approach is better than traditional CMS

What will we be using for this short demo?

For this short demo on Headless CMS approach we will be using StoryBlok.

Storyblok – Headless CMS: Organize your content for the world
Storyblok helps your team to tell your story and manage content for every use-case: corporate websites, e-commerce…www.storyblok.com

It provides you an API with all your data you have entered into it.

I won’t go into too much detail over this -but all you need to do is create your own space and then define schema and then publish that in the content and go to settings to generate your token and then get the API.

That’s basically it!

Now to get onto the coding part!

How to handle API ?

There are multiple ways of handling an API call in flutter, but the simplest would be to use the http package from pub.dev, just paste that in the pubspec.yaml file.

http: any

That’s all you needed to do. Now to use this package we will import it as below

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

We have added as “http” there so that we can use its functions with ease,

Now to make an API call we can do that by making a separate function called _fetch() and make it asynchronous.

_fetch() async {

}

Now inside that function we need to make a variable that will help us get the response from the API so we will call that response.

Its type would be of http.Response, its always better to define the types,

and to give this variable value, It will have the value of http.get(“ <YOUR API HERE>”);.

Be sure to put in await before that so that we can wait for it to get the response from the API

_fetch() async {
final http.Response response = await http.get("https://api.storyblok.com/v1/cdn/stories?page=1&token=5kNqPrD6wYQRHakzUrxrGwtt");
}

Now once we are done with the API call and have gotten the response we need to check if that response was correct or not and we do that by accessing a property of http.Response type variables that is statusCode

We make a simple check that if the statusCode was 200 then no error occurred and we got the response we desired.

if(response.statusCode ==200) {

// YOUR FUNCTION BODY HERE
}

for now once we get the API response and the statusCode is 200 lets decode it.

For that we will use an inbuilt method called jsonDecode(<YOUR RESPONSE VARIABLE>)

final Map<String,dynamic> json = jsonDecode(response.body);

We have accessed the body of the response we got and have gotten that body part into a json variable which is of type Map<String,dynamic>.

now we can just print the json and get all the data we require, to use the data we can use it like we use any other map

However i recommend making a Modal class for dealing with this, an example would be

class Fetch {
final name;
final created;
final published;
final alternates;
final id;
final uuid;
final content;
final slug;
final full_slug;
final default_full_slug;
final sort_by_date;
final position;
final tag_list;
final isStartPage;
final parent_id;
final meta_data;
final release_id;
final lang;
final path;
final translated_slugs;

Fetch({this.name, this.created, this.published, this.alternates, this.id,
this.uuid, this.content, this.slug, this.full_slug,
this.default_full_slug, this.sort_by_date, this.position, this.tag_list,
this.isStartPage, this.parent_id, this.meta_data, this.release_id,
this.lang, this.path, this.translated_slugs});

factory Fetch.fromFetch( map) {
return Fetch(
name: map["name"],
created: map["created_at"],
published: map["published_at"],
alternates: map["alternates"],
id: map["id"],
uuid: map["uuid"],
content: map["content"],
slug: map["slug"],
full_slug: map["full_slug"],
default_full_slug: map["default_full_slug"],
sort_by_date: map["sort_by_date"],
position: map["position"],
tag_list: map["tag_list"],
isStartPage: map["is_startpage"],
parent_id: map["parent_id"],
meta_data: map["meta_data"],
release_id: map["release_id"],
lang: map["lang"],
path: map["path"],
translated_slugs: map["translated_slugs"]
);
}


}

So we have defined all the keys in the map as a variable here and we are gonna make an object of this Modal class and use that object to show what we want from the json data.

If you want more help making a Modal class you can contact me anytime you like

Now how we provide data from json to it?

Its beyond simple really i usually do it like this

List list = json['stories'];
print(list);
list.map((i) {
Fetch fetch = Fetch.fromFetch(i);
print(fetch.id);
print("fetch name => ${fetch.name}");
}).toList();

Well in my json ‘stories’ was a key which had a List as its value so i made this so i can get the data of all list items into my modal class and print them,

You can declare another List of type Fetch and add in it the fetch instance so that you can use it whenever you like,

Example

List<Fetch> fetchList =[];
List list = json['stories'];
print(list);
list.map((i) {
Fetch fetch = Fetch.fromFetch(i);
fetchList.add(fetch);

}).toList();

Now this makes our work much, much easier. Instead of writing the key in strings over and over again we can simply use it like fetchList[0].name or fetchList[0].id etc.

Now all that is left is to either bind it to a button or if you want to run it at app startup then call the function in initState();

As always you can find the full code for this in the GitHub. Hope you guys enjoyed reading through this, If you have any queries be sure to let me know, and i will try to solve them.


From Our Parent Company Aeologic

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

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

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

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

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

Related: SMS Using Twilio In Flutter

Related: Using SharedPreferences in Flutter

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

Complete Guide to AWS Amplify Auth in Flutter 2026

0

Authorization and Authentication in your apps plays an important role and we’re very well aware of the fact in day-to-day acitivities. Motsly every app that we install needs you to authenticate yourself before you could use it and same goes for authorization. In Flutter we have been doing this using Firebase

What’s AWS Amplify ?

AWS Amplify is a set of tools and services that enables mobile and front-end web developers to build secure, scalable full stack applications, powered by AWS. With Amplify, it’s easy to create custom onboarding flows, develop voice-enabled experiences, build AI-powered real-time feeds, launch targeted campaigns, and more. No matter the use case, AWS Amplify helps you develop and release great apps your customers will love. AWS Amplify includes an open-source framework with use-case centric libraries and a powerful toolchain to create and add cloud-based features to your app, and a web hosting service to deploy static web applications.

Pre-requisites:

npm install -g @aws-amplify/cli@flutter-preview

Note: If you don’t have nodejs and npm already installed, please use install Npm and NodeJs beforehand. Also,an already existing install of @aws-amplify/cli wont work, you may need to install flutter-preview version.

  • You need to sign up for an AWS account if you don’t already have it.

Integrate Amplify into your app:

Now, here for this demo, I’m going to use the Auth flow of the app using AWS which generally I use to do using Firebase before so I’m assuming that you have the demo UI for the Sign-Up and Sign-In flow ready as I won’t be going to the UI part here.

  • Import Amplify packages into your project inside the pubspec.yaml file:
amplify_core:  latest version 
amplify_auth_cognito: latest version
  • Fetch the Amplify packages entered above using the below command:
flutter pub get
  • To make sure you have installed the proper amplify cli version run the below command:
amplify --version

Note: The output of this command should have “-flutter-preview” appended to it. If not, then run “npm install -g @aws-amplify/cli@flutter-preview” in the terminal.

  • Now that you have the correct version of amplify installed, it’s time to connect to the AWS cloud and for that, we need to initialize the amplify, use the following command to initialize the Amplify:
amplify init
  • The next step is to configure the user for AWS. This will help create a new user or set an already created user for this project. Use the following command to configure AWS:
amplify configure
AWS User creation process

What is AWS Cognito?

Amazon Cognito lets you add user sign-up, sign-in, and access control to your web and mobile apps quickly and easily. Amazon Cognito scales to millions of users and supports sign-in with social identity providers, such as Facebook, Google, and Amazon, and enterprise identity providers via SAML 2.0.

This will help set up social sign-in, user authentication which we are going to integrate into our demo. The AWS amplify category has a default, built-in support for the AWS Cognito.

Prerequisites:

  • A Flutter application with Flutter SDK ≥1.20 and Amplify libraries integrated as mentioned above.

Configurations:

To start using the auth resources into your project run the following command into the terminal

amplify add auth
  • You’ll be prompted with few questions to configure the auth preferences just go with the defaults,
? Do you want to use the default authentication and security configuration? `Default configuration` 
? How do you want users to be able to sign in? `Username`
? Do you want to configure advanced settings? `No, I am done.`
  • After the auth configuration has been set you need to push all these changes made till now to the cloud and for that, you can use the below command,
amplify push 

Auth using Amplify:

Now that the basic setup has been done and if everything did go well then you can proceed ahead with the Auth flow integration into your UI for registration and sign-in .

For SignUp:

Just like you use to handle Firbase Auth flow in the signup screen, just need to implement AWS api calls.

try {
Map<String, dynamic> userAttributes = {
"email": emailController.text,
"phone_number": phoneController.text,
// additional attributes as needed
};
SignUpResult res = await Amplify.Auth.signUp(
username: "myusername",
password: "mysupersecurepassword",
options: CognitoSignUpOptions(
userAttributes: userAttributes
));
} on AuthError
catch (e) {
print(e);
}

Now, the user will be confirmed. For that, a confirmation code will be sent to the email address by the user. You need to create a separate UI for the confirmation code as the user have to enter the code received in his/her email and will passed to the confirmSignUp call.

try {
SignUpResult res = await Amplify.Auth.confirmSignUp(
username: "myusername",
confirmationCode: "123456"
);
} on AuthError catch (e) {
print(e);
}

Upon the successful completion of signup flow you can see Confirm signUp Succeded message on the terminal.

For SignIn:

In the SignIn UI, imlement the AWS signIn api calls.

try {
SignInResult res = await Amplify.Auth.signIn(
username: usernameController.text.trim(),
password: passwordController.text.trim(),
);
} on AuthError catch (e) {
print(e);
}

Upon the successful completion of signin flow you can see Sign in Succeded message on the terminal.


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, and Twitter for any flutter related queries.

Related: Integrating Firebase Auth in FlutterFlow: Step-by-Step Guide

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

Custom Progress Indicator In Flutter

In this article, we will explore the Custom Progress Indicator in a flutter Using the liquid progress indicator package. With the help of the package, we can easily achieve flutter animated liquid wave progress indicators.

We will implement a demo of the Custom Progress Indicator that can be easily embedded in your flutter applications.


Table Of Contents :

Custom Progress Indicator

Implementation

Code Implement

Code File

Conclusion


Custom Progress Indicator :

A Custom liquid progress indicator is what we’ll actually use to draw our animated liquid wave progress bar. Liquid Custom Progress Indicator sub-classes need to implement the liquid progress bar Custom Progress Indicator .with the help of custom indicator, we can give custom shape to our progress bar.

Demo Module :

Implementation :

Step 1: Add dependencies.

Add dependencies to pubspec — yaml file.

dependencies:
liquid_progress_indicator: ^0.3.2

Step 2: import the package :

import 'package:liquid_progress_indicator/liquid_progress_indicator.dart';

Step 3: Run flutter package get

Code Implement :

Create a new dart file is called custom_progress_indicator.dart inside the lib folder

In this screen,First of all,We have set the percentage timer in the init state which will increase the timer when the progress bar in running them in your Application.

@override
void initState() {
Timer timer;
timer = Timer.periodic(Duration(milliseconds:300),(_){
print('Percent Update');
setState(() {
percent+=1;
if(percent >= 100){
timer.cancel();
// percent=0;
}
});
});
super.initState();
}

Now we will initialize the LiquidCircularProgressIndicator which is a progress bar show in liquid form.

LiquidCircularProgressIndicator(
value:percent/100, // Defaults to 0.5.
valueColor: AlwaysStoppedAnimation(Colors.pink),
backgroundColor: Colors.white,
borderColor: Colors.red,
borderWidth:4.0,
direction: Axis.vertical,
center:Text(percent.toString() +"%",style: TextStyle(fontSize:12.0,fontWeight: FontWeight.w600,color: Colors.black),),
),

Now we will initialize the LiquidLinearProgressIndicator which is a progress bar show in liquid form.

LiquidLinearProgressIndicator(
value:percent/100,
valueColor: AlwaysStoppedAnimation(Colors.pink),
backgroundColor: Colors.white,
borderColor: Colors.red,
borderWidth: 5.0,
borderRadius: 12.0,
direction: Axis.horizontal,
center:Text(percent.toString() +"%",style: TextStyle(fontSize:12.0,fontWeight: FontWeight.w600,color: Colors.black),),

),

Creating Our Custom Shaped Indicator :

LiquidCustomProgressIndicator(
value:percent/100,
valueColor: AlwaysStoppedAnimation(Colors.cyan),
backgroundColor: Colors.grey[100],
Colors.black),),
direction: Axis.vertical,
shapePath:_buildBoatPath(),
),

Code File :

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:liquid_progress_indicator/liquid_progress_indicator.dart';
import 'dart:math' as math;

class CustomProgressIndicator extends StatefulWidget {
@override
_CustomProgressIndicatorState createState() =>
_CustomProgressIndicatorState();
}

class _CustomProgressIndicatorState extends State<CustomProgressIndicator> {
double _height;
double _width;

double percent = 0.0;

@override
void initState() {
Timer timer;
timer = Timer.periodic(Duration(milliseconds: 300), (_) {
print('Percent Update');
setState(() {
percent += 1;
if (percent >= 100) {
timer.cancel();
// percent=0;
}
});
});
super.initState();
}

@override
Widget build(BuildContext context) {
_height = MediaQuery.of(context).size.height;
_width = MediaQuery.of(context).size.width;

return Scaffold(
appBar: AppBar(
title: Text(
"Liquid Progress Bar",
style: TextStyle(color: Colors.black),
),
backgroundColor: Colors.white,
centerTitle: true,
),
body: Container(
height: _height,
width: _width,
padding: EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
Text(
'Liquid Circular Progress Indicator',
style: TextStyle(
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
fontSize: 15),
),
SizedBox(
height: 40,
),
Container(
height: 130,
width: 130,
child: LiquidCircularProgressIndicator(
value: percent / 100,
// Defaults to 0.5.
valueColor: AlwaysStoppedAnimation(Colors.pink),
backgroundColor: Colors.white,
borderColor: Colors.red,
borderWidth: 4.0,
direction: Axis.vertical,
center: Text(
percent.toString() + "%",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
color: Colors.black),
),
),
),
],
),
Column(
children: [
Text(
'Liquid linear progress indicator',
style: TextStyle(
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
fontSize: 15),
),
SizedBox(
height: 40,
),
Container(
height: 40,
child: LiquidLinearProgressIndicator(
value: percent / 100,
valueColor: AlwaysStoppedAnimation(Colors.pink),
backgroundColor: Colors.white,
borderColor: Colors.red,
borderWidth: 5.0,
borderRadius: 12.0,
direction: Axis.horizontal,
center: Text(
percent.toString() + "%",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
color: Colors.black),
),
),
),
],
),
Column(
children: [
Text(
'Liquid custom progress indicator.',
style: TextStyle(
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
fontSize: 15),
),
Container(
child: LiquidCustomProgressIndicator(
value: percent / 100,
valueColor: AlwaysStoppedAnimation(Colors.cyan),
backgroundColor: Colors.grey[100],
direction: Axis.vertical,
shapePath: _buildBoatPath(),
),
),
],
),
],
),
),
);
}

Path _buildBoatPath() {
return Path()
..moveTo(15, 120)
..lineTo(0, 85)
..lineTo(50, 85)
..lineTo(60, 80)
..lineTo(60, 85)
..lineTo(120, 85)
..lineTo(105, 120) //and back to the origin, could not be necessary #1
..close();
}
}

Conclusion :

In this article, I have explained a Custom Progress Indicator demo, you can modify and experiment according to your own, this little introduction was from the date time picker from our side.

I hope this blog helps will provide you with sufficient information in Trying up the Custom Progress Indicator in your flutter project. In this demo explain the liquid progress bar through the liquid_progress_indicator package in a flutter. 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 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.

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

Implement Showcase In Flutter

An extraordinary application UI limits the friction between user and application usefulness. A method for decreasing that grating is to feature and showcase the parts of your application. This is useful when a user launches your application interestingly. With the assistance of the Showcase and ShowCaseWidget widget, we can showcase the feature in the Flutter application.

This article will explore the Implement Showcase In Flutter. We will see how to implement a demo program. It will show a highlight of our app using the showcaseview package in your flutter applications.

showcaseview | Flutter Package
A Flutter package allows you to Showcase/Highlight your widgets step by step. Add dependency to pubspec.yaml Get the…pub.dev


Table Of Contents::

Introduction

Constructor

Parameters

Implementation

Code Implement

Code File

Conclusion



Introduction:

The showcase will feature the fundamental features of our application. At the point when the user taps on the screen, the widgets we have as a component of the feature will be introduced in a predefined request.

Demo Module::

This demo video shows how to implement the Showcase in a flutter and shows how a Showcase will work using the showcaseview package in your flutter applications. We will show a user press on the screen, then the showcase will be presented and When you run the app, the showcase will start instantly on the main page. It will be shown on your device.

Constructor:

To utilize Showcase, you need to call the constructor underneath:

const Showcase({
required this.key,
required this.child,
this.title,
required this.description,
this.shapeBorder,
this.overlayColor = Colors.black45,
this.overlayOpacity = 0.75,
this.titleTextStyle,
this.descTextStyle,
this.showcaseBackgroundColor = Colors.white,
this.textColor = Colors.black,
this.scrollLoadingWidget = const CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.white)),
this.showArrow = true,
this.onTargetClick,
this.disposeOnTap,
this.animationDuration = const Duration(milliseconds: 2000),
this.disableAnimation,
this.contentPadding =
const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
this.onToolTipClick,
this.overlayPadding = EdgeInsets.zero,
this.blurValue,
this.radius,
this.onTargetLongPress,
this.onTargetDoubleTap,
})

All fields marked with @required must not be empty in the above Constructor.

Parameters:

There are some parameters of Showcase are:

  • > key: This parameter is used to unique GlobalKey to identify features showcased.
  • > child: This parameter is used to the widget can only have one child. To layout multiple children, let this widget’s child be a widget such as Row, Column, or Stack, which have a children property, and then provide the children with that widget.
  • > description: This parameter displays a string about the showcased feature.
  • > animationDuration: This parameter is used for the duration over which to animate the parameters of this container. It represents a difference from one point in time to another.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:
flutter:
sdk: flutter
showcaseview: ^1.1.6

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:
- assets/

Step 3: Import

import 'package:showcaseview/showcaseview.dart';

Step 4: 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.

Before we implement the showcase for individual widgets, we want to wrap our page that will show the showcase with a ShowCaseWidget. We should set the required builder parameter, which will contain the Builder widget returning our ShowcaseDemo.

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter ShowCase Demo',
debugShowCheckedModeBanner: false,
home: Scaffold(
body: ShowCaseWidget(
builder: Builder(builder: (context) => const ShowcaseDemo()),
),
),
);
}

Presently, we will make a ShowcaseDemo class in the main. dart file. The ShowCaseWidget to know which widgets we need to be showcased, we want to make a key for all of those widgets. In our application, there are five widgets we need to bring to the consideration of our users when they arrive at the ShowcaseDemo.

final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
final GlobalKey _first = GlobalKey();
final GlobalKey _second = GlobalKey();
final GlobalKey _third = GlobalKey();
final GlobalKey _fourth = GlobalKey();
final GlobalKey _fifth = GlobalKey();

For the showcase to begin on page construct, we should call the startShowCase the strategy within the initState of the ShowcaseDemo.

Note, notwithstanding, that calling this technique simply the manner in which we did in the button would deliver an error. To keep this from occurring, we really want to put this strategy call inside a callback function and give it to WidgetsBinding.instance!.addPostFrameCallback(). This will guarantee that everything is executed accurately during the build.

Presently, if you run the application, our delightful showcase will begin when the page builds. Tap through it until the showcase is done.

@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback(
(_) => ShowCaseWidget.of(context)
.startShowCase([_first, _second, _third, _fourth, _fifth]),
);
}

In the build method, we will return Scaffold. We will add _scaffoldKey

@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,
......
)}

First Showcase will be added on AppBar. We will add a key, description, and its child. Its child, we will add IconButton. In this button, we will add onPressed and icon.

leading: Showcase(
key: _first,
description: 'Press here to open drawer',
child: IconButton(
onPressed: () {
_scaffoldKey.currentState!.openDrawer();
},
icon: const Icon(Icons.menu),
),
),

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

First Showcase Output

Then, Second Showcase we will add an app bar title with the key, description, and child. In a child, we will add the text “Flutter Showcase Demo”. In a description, we will add the string “This is a demo app title”.

title: Showcase(
key: _second,
description: 'This is a demo app title',
child: const Text('Flutter Showcase Demo')),

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

Second Showcase Output

Now, we will add a third Showcase on an action widget. In this widget, We will add a key was _third, the description was “Press to see notification” and, child.

actions: [
Showcase(
key: _third,
description: 'Press to see notification',
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.notifications_active)))
],

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

Third Showcase Output

Next, we will add a fourth Showcase on a body part. In the body, we will add the Column widget. In this widget, we will add crossAxisAlignment and mainAxisAlignment as the center. Its child, we will add the Showcase method. In this method, we will add key was _fourth, the description was “FlutterDevs specializes in creating cost-effective and efficient applications”, and child. In a child, new will add an image.

Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Center(
child: Showcase(
key: _fourth,
description:
'FlutterDevs specializes in creating cost-effective and efficient applications',
child: Image.asset(
"assets/logo.png",
height: 400,
width: 350,
)),
),
],
),

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

Fourth Showcase Output

We will create a floatingActionButton equal to the Showcase widget. In this widget, we will add a key that was _fifth, the title was “Add Image’”, the description was “Click here to add new Image”.

floatingActionButton: Showcase(
key: _fifth,
title: 'Add Image',
description: 'Click here to add new Image',
shapeBorder: const CircleBorder(),
child: FloatingActionButton(
backgroundColor: Colors.cyan,
onPressed: () {},
child: const Icon(
Icons.image,
),
),
),

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

Fifth Showcase Output

Code File:

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

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

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

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter ShowCase Demo',
debugShowCheckedModeBanner: false,
home: Scaffold(
body: ShowCaseWidget(
builder: Builder(builder: (context) => const ShowcaseDemo()),
),
),
);
}
}

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

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

class _ShowcaseDemoState extends State<ShowcaseDemo> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
final GlobalKey _first = GlobalKey();
final GlobalKey _second = GlobalKey();
final GlobalKey _third = GlobalKey();
final GlobalKey _fourth = GlobalKey();
final GlobalKey _fifth = GlobalKey();

@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback(
(_) => ShowCaseWidget.of(context)
.startShowCase([_first, _second, _third, _fourth, _fifth]),
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: const <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Colors.cyan,
),
child: Text(
'Drawer Header',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
),
ListTile(
leading: Icon(Icons.account_circle),
title: Text('Profile'),
),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
),
],
),
),
appBar: AppBar(
leading: Showcase(
key: _first,
description: 'Press here to open drawer',
child: IconButton(
onPressed: () {
_scaffoldKey.currentState!.openDrawer();
},
icon: const Icon(Icons.menu),
),
),
actions: [
Showcase(
key: _third,
description: 'Press to see notification',
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.notifications_active)))
],
title: Showcase(
key: _second,
description: 'This is a demo app title',
child: const Text('Flutter Showcase Demo')),
centerTitle: true,
automaticallyImplyLeading: false,
backgroundColor: Colors.cyan,
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Center(
child: Showcase(
key: _fourth,
description:
'FlutterDevs specializes in creating cost-effective and efficient applications',
child: Image.asset(
"assets/logo.png",
height: 400,
width: 350,
)),
),
],
),
floatingActionButton: Showcase(
key: _fifth,
title: 'Add Image',
description: 'Click here to add new Image',
shapeBorder: const CircleBorder(),
child: FloatingActionButton(
backgroundColor: Colors.cyan,
onPressed: () {},
child: const Icon(
Icons.image,
),
),
),
);
}
}

Conclusion:

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

I hope this blog will provide you with sufficient information on Trying the Implementing Showcase in your flutter projectsWe will show you what the Introduction is. Make a demo program for working Showcase using the showcaseview 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.

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 Facebook, GitHub, Twitter, and LinkedIn.

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

Related: SMS Using Twilio In Flutter

Related: Using SharedPreferences in Flutter

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


Crashlytics In Flutter

0

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

App Stability is a Prominent Factor that can obstruct the success of even the Best Apps. Apps with Bugs can be really frustrating that may tend to make the users UnHappy Culminating to App Uninstalls, Bad App Store Reviews, or a Negative Social Media Feed explaining the Bad Experience that may In turn affect the brand image.

This might would have surely encouraged you to make your Apps Bug-free but a varied kind of crashes can be generated in apps making it difficult & Time-Consuming to manually track them So that you can prioritise which crashes to troubleshoot and fix first.

Firebase Crashlytics helps By Automatically collecting, Analyzing, and Organizing Crash Reports so that we can prioritise Important Issues firstly Keeping our Users happy.

In This Article : The Focus will Be Mainly on Integrating Firebase Crashlytics In Your Flutter Apps


Table of Content :

:: Flutter — Introduction

:: Firebase — Introduction

:: Firebase Crashlytics — Introduction , Key Capabilities

:: Firebase Crashlytics — Implementation Pattern

:: Firebase Crashlytics — Setup Initial Configuration

:: Closing Thoughts


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

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

Intro to the Topic : Firebase Crashlytics 🚀

Firebase Crashlytics — Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality.

The Most Powerful, yet Lightest Weight Crash Reporting Solution

Crashlytics helps using 3 main aspects :

  • Logs: Each events in app is logged so that conext can be provided alongwith crash reports on the event of app crash
  • Crash reports: Crash reports is made up each time a crash occurs and sent up on the application being run the next time .
  • Stack traces: If the app recovers from an error , Dart Stack trace help in still Reporting the error.

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

Firebase Crashlytics : Key Capabilities

Crashlytics Key Capabilities
  • :: Curated Crash Reports — Firebase Crashlytics amalgamate an avalanche of crashes Into a well curated & identifiable list of issues providing contextual informaion highlighting the seriousness & pervasiveness of crashes so that you can easily pinpoint the root crash cause .
  • :: Cures for Common Crash — Crashlytics provides Crash Insights highlighting the common stability problems . Also providing great resources that make them easier to troubleshoot — Priortize & Resolve .
  • :: Analytics Inegraion — Crashlytics alongwith Analytics provide Audience Insights with Crash Analytics report for users & Simplify debugging by giving you access a list of other events leading up to each crash .
  • :: Realtime alerts — Crashlytics will help you get realtime alerts for new issues, regressed issues, and growing issues that might require immediate attention.

Implementation Pattern : Firebase Crashlytics

Let us understand the Implementation pattern of Firebase Crashlytics:-

Firebase Crashlytics saves you troubleshooting time by Intelligently Grouping Crashes and Highlighting the circumstances that lead up to them.

  • : Connect Your App — Add On Firebase To Your Apps.
  • : Integrate The SDK — Add the Crashlytics SDK
  • : Check Firebase Console — Visit the Firebase console to track, prioritize, and fix issues in your app.

Firebase Crashlytics — Setup & Initial Configuration

In order to Integrate Crashlytics, We need to create a firebase project for the Firebase Crashlytics 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.

iOS app Integration
  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 the Flutter app later.

google-service.json
  • 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.

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 Crashlytics plugin In Flutter App :

Add Package Dependency in pubspec.yamland the run Flutter pub get :

firebase_crashlytics: "^0.2.0"

Add the following classpath to your android/build.gradle file :

dependencies {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'}

Apply the following Plugin to the end of your android/app/build.gradle file.

apply plugin: 'com.google.firebase.crashlytics'

Add the Firebase Crashlytics SDK, in your android/app/build.gradle files.

dependencies {
// Adding Firebase Crashlytics SDK
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
}

iOS :

: Select Runner at project navigation from Xcode .

: Then Select the Tab Build phase => Click on + > New Run Script Phase

: Add ${PODS_ROOT}/FirebaseCrashlytics/run to the Type a script.. text box.

Import package At Your Project File:

import 'package:firebase_crashlytics/firebase_crashlytics.dart';

Add Firebase Crashlytics Instance In Your Flutter App :

void main() {
// Set `enableInDevMode`to true to see reports while in debug mode
// This is only to be used for confirming that reports are being
// submitted as expected. It is not intended to be used for //everyday development.
  Crashlytics.instance.enableInDevMode = true;

// Pass all uncaught errors to Crashlytics.
FlutterError.onError = Crashlytics.instance.recordFlutterError;
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]).then((_) {
SharedPreferences.getInstance().then((prefs) {
var darkModeOn = prefs.getBool('darkMode') ?? true;
runZoned(() {
runApp(ChangeNotifierProvider<ThemeNotifier>(
create: (_) => ThemeNotifier(darkModeOn ? darkTheme : lightTheme),
child: MyApp(),
));
}, onError: Crashlytics.instance.recordError);
});
});
}

Rebuild your app :

$ flutter run

You will be abled to see the crashlytics dashboard in firebase console on successful installation

Crashlytics Console

Closing Thoughts

We have familiarised ourselves with Firebase Crashlytics — Integration in apps. They can be embodied as a tool that can play an Influential role in Strengthening Up of Apps By Availing Curated Crash Reports, Curing Common Crashes, Getting Realtime Updates to Prioritize Bug Fixing & It’s Integration with Analytics to Contemplate Future Campaign Strategies. Hope After reading the article you must have gotten insightful of Firebase Crashlytics in Flutter. Give it a TRY!!


To find out more about Firebase Crashlytics :

Check out the documentation here and Give them a Try — A link away.

References For the Blog :

firebase_crashlytics | Flutter Package
A Flutter plugin to use the Firebase Crashlytics Service. For Flutter plugins for other Firebase products, see…pub.dev

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
Firebase gives you functionality like analytics, databases, messaging and crash reporting so you can move quickly and…firebase.google.com

Crashlytics | FlutterFire
Crashlytics helps you to collect analytics and details about crashes and errors that occur in your app. It does this…firebase.flutter.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.

Related: Auth using AWS Amplify In Flutter

Related: Maintain Activity Log in Firebase Using FlutterFlow

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

Custom AppBar in Flutter

0

Flutter is an amazing UI tool kit used to make beautiful apps using a single codebase for android and ios. Using flutter we can build highly Animated widgets with ease. Flutter allows us to deliver Interactive applications that allow the developer to grab User Retention.

In this, we shall learn about how to build an animated AppBar. Building this AppBar will help you to learn and explore new widgets.


What we will build?

Build Up an Animated Appbar that will change its color on scrolling in any direction. Particularly, App bar items: drawer icon, action widget, and title text will change color to white in scroll direction downward and blue in upward scroll to its original formal color.

Demo of Module :

AppBar Demo Module *gif*

Table of content

:: Notification Listener

::AnimatedBulder

::Animation

:: Create the Custom AppBar


                     *** NotificationListener ***                         
  • NotificationListerner is a widget that listens to the notification and it will start bubbling that notification at the given buildContext.
  • This notification will be delivered to all the ancestors widgets that need to be changed on any effect or event eg. Scrolling of the given BuildContext.
  • It takes a onNotification property, it is a function that handles the callBacks.

Initializing NotificationListener

scrollListener

It a bool function that returns a bool value. Here if the ScrollNotication axis is vertical then only scroll will be true.


AnimatedBuilder

  • AnimatedBuilder is a widget that is used to create animated widgets eg. rotating Image, changing colors of widgets, etc…
  • It takes Animation and a Builder. The builder builds the animated widget and Animation creates the animation effects.
  • We must initialize the AnimationController inside the initState of the stateful widget.

You can read out the offical example of AnimatedBuilder for better understanding :

AnimatedBuilder class
A general-purpose widget for building animations. AnimatedBuilder is useful for more complex widgets that wish to…api.flutter.dev


       *** Animation ***

Introduction to Animation in Flutter
Let’s learn how to animate flutter widgets…medium.com

Creating the AppBar :

Initializing Animation and AnimationController

As you can see in the AppBar there are five widgets that are changing their colors while AppBar animation i.e. AppBar, Drawer Icon, Action Icon, Hello Text, UserName Text. So for these widgets, we will need 5 Animation :

Animation _colorTween, _homeTween, _workOutTween, _iconTween, _drawerTween;

This Animation objects will control the change of the colors of the above widgets. Also, we will be needing the AnimationController :

AnimationController _ColorAnimationController;
AnimationController _TextAnimationController;

To Learn Up Animation Basics like tween go through the Blog Introduction to Animation in Flutter.

We have to initialize the AnimationController, ColorTween inside the initState method.

@override
void initState() {
_ColorAnimationController =
AnimationController(vsync: this, duration: Duration(seconds: 0));
_colorTween = ColorTween(begin: Colors.transparent, end: Colors.white)
.animate(_ColorAnimationController);
_iconTween =
ColorTween(begin: Colors.white, end: Colors.lightBlue.withOpacity(0.5))
.animate(_ColorAnimationController);
_drawerTween = ColorTween(begin: Colors.white, end: Colors.black)
.animate(_ColorAnimationController);
_homeTween = ColorTween(begin: Colors.white, end: Colors.blue)
.animate(_ColorAnimationController);
_workOutTween = ColorTween(begin: Colors.white, end: Colors.black)
.animate(_ColorAnimationController);
_TextAnimationController =
AnimationController(vsync: this, duration: Duration(seconds: 0));

super.initState();
}

This code is about initializing all the objects that we have created earlier. You can also add the animations effects curves.

TIP:: You should always initialize the AnimationController, ColorTween, Tween inside the initState method……..💡💡

CustomAppBar using the AnimaionBuilder .

You might be aware of how to code an AppBar in Flutter. But this approach is different, as we will use AnimationBuilder and Stack widget to make this type of custom AppBar. Here AnimaionBuilder will return an AppBar that we will use in the Stack inside the main Scaffold .

I have made a separate widget for AppBar to keep our code clear and easy to understand and manage.

https://gist.github.com/anmolseth06/8a3b32424a7572ad3764301b9bb533be#file-customappbar-dart

Here I have used a Container height 80, and the child of that Container is a AnimationBuilder that builds the AppBar. Also, we will change the icon of the Drawer because if we use the default Drawer then neither you can change the color of the icon nor the icon of the Drawer. To open that Drawer on taping that icon can be achieved through GlobalKey . Also, I have used Function onPressed to pass the function that will open the Drawer.

NOTE : GlobalKey must be initialized inside the main file where you will use this Custom AppBar…📝

Creating a GlobalKey object

final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();

This is how you will initialize the AnimatedAppBar widget.

AnimatedAppBar(
drawerTween: _drawerTween,
onPressed: () {
scaffoldKey.currentState.openDrawer();
},
colorAnimationController: _ColorAnimationController,
colorTween: _colorTween,
homeTween: _homeTween,
iconTween: _iconTween,
workOutTween: _workOutTween,
)

NOTE : Don’t forget to add this line inside the main Scaffold ::drawer: Drawer(), 📝

https://gist.github.com/anmolseth06/c099384aac15b640cd1560a8a68ec463#file-landingpage-dart

Now you are ready to go to implement animation into your apps. Thanks…

VIDEO REFERENCES :


🌸🌼🌸 Thank you for reading. 🌸🌼🌸🌼


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.

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


From Our Parent Company Aeologic

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

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

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

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

Related: Custom Rolling Switch In Flutter

Related: Custom Dialog In Flutter

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