Google search engine
Home Blog Page 63

Positioned Transition Widget In Flutter

0

Whenever building an app animation plays a vital role in designing the experience of the user. People tend to like an app that has a smooth flow and a slick design. The Flutter Package provides a variety of methods to create and use animation in our app. We will be discussing the inbuilt Flutter widgets to handle animation.

In this article, we will explore the Positioned Transition Widget. We will see how to implement a demo program to create a sample app that shows an animation in your flutter applications.

Animated version of Positioned which takes a specific Animation<RelativeRect> to transition the child’s position from a start position to an end position over the lifetime of the animation. Only works if it’s the child of a Stack. These are the simplest widget provided by flutter. These widgets can be implemented without much work from the developer. These are very basic animation techniques, so they don’t have many options available to be changed. They have the properties to control the repetition and movement of the widget. These widgets require a Controller for the granular control they provide.


Table Of Contents::

Introduction

Properties

Use of Positioned Transition

Conclusion

GitHub Link


Introduction:

Hello everyone, This is my first ever article on Flutter. Positioned Transition is a very powerful widget if we look deep into it. It provides us with an interface using the Positioned Transition so that we can do various types of animations. We change the position of a widget with animation by using Positioned Transition widget. You’ll see that using widgets and animating them can make your app more visually appealing.

Positioned Transition widget allows for a child to move from one position to another in an animation.

The Default Constructor of it will look like below:

PositionedTransition({
Key key,
@required Animation<RelativeRect> rect,
@required Widget child,
});

Properties:

  • > child: The widget below this widget is in the tree. This 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 to that widget.

Implementation:

final Widget child;
  • > key: It’s controls how one widget replaces another widget in the tree. Using a GlobalKey as the widget’s key allows the element to be moved around the tree (changing parent) without losing state. When a new widget is found (its key and type do not match a previous widget in the same location), but there was a widget with that same global key elsewhere in the tree in the previous frame, then that widget’s element is moved to the new location. Generally, a widget that is the only child of another widget does not need an explicit key.

Implementation:

final Key key;
  • > Animation<RelativeRect> rect: An immutable 2D, axis-aligned, floating-point rectangle whose coordinates are given relative to another rectangle’s edges, known as the container. This parameter is used to define the animation that controls the child’s size and position. It determines the width or height of the rectangle, converts it to a Rect using toRect() (passing the container’s own Rect), and then examines that object. The fields left, right, bottom, and top must not be null.

Implementation:

RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0)

Implementation:

const RelativeRect.fromLTRB(
this.left,
this.top,
this.right,
this.bottom)
: assert(
left != null && top != null && right != null && bottom != null);

RelativeRect.fromRect(Rect rect, Rect container) Creates a RelativeRect from two Rects. The second Rect provides the container, the first provides the rectangle, in the same coordinate space, that is to be converted to a RelativeRect. The output will be in the container’s coordinate space.

Implementation:

factory RelativeRect.fromRect(Rect rect, Rect container) {
return RelativeRect.fromLTRB(
rect.left – container.left,
rect.top – container.top,
container.right – rect.right,
container.bottom – rect.bottom
); }

RelativeRect.fromSize(Rect rect, Size container). Creates a RelativeRect from a Rect and a Size. The Rect (first argument) and the RelativeRect (the output) are in the coordinate space of the rectangle described by the Size, with 0,0 being at the top left.

Implementation:

factory RelativeRect.fromSize(Rect rect, Size container) {
return RelativeRect.fromLTRB(
rect.left,
rect.top,
container.width - rect.right,
container.height - rect.bottom);
}

  • > listenable: The listeners are typically used to notify clients that the object has been updated.

Use of Positioned Transition:

For the “Positioned Transition” first we need to create an AnimatedController() in which we pass the duration for the animation. and create a dispose of () for dispose of the controller. After that we create a method that returns the Container() and returns the GestureDetector() as a child of the container, In the onTap() we pass a condition that if the controller has completed so it revers the image otherwise foreword the image. and pass image as a child of GestureDetector().

positioned_transition_home.dart

In BuildContext() we pass the variable smallSize and largeSize and also pass the screenSize. In the body of the class, we pass stack because in this we have to take stack as a child, and pass PositionedTransition() as a child and in the properties of positionedTransition we use rect, In this, we use RelativeRectTween() for set the begin and end. And use animate(), we pass controller as a parent of CurvedAnimation() and pass curve. After that, we return the method which returns the container.

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


Conclusion:

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.

GitHub Link:

find the source code of the Positioned Transition Widget:

GitHub – flutter-devs/PositionedTransition
You can’t perform that action at this time. You signed in with another tab or window. You signed out in another tab or…github.com


From Our Parent Company Aeologic

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

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

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

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

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


Motion Toast In Flutter

0

In this article, we will explore the Motion Toast In Flutter. We will see how to implement a demo program to create a motion toast and also shows a display animation in your flutter applications.


Table Of Contents:

What is Motion Toast?

Installation

Flutter motion toast attributes

Flutter Motion Toast / Styled Toast Built-In Types

Conclusion

GitHub Link


What is Motion Toast?:

Motion toast is an open-source flutter package that lets you display messages in toast in a user-friendly way, with multiple built-in themes.

Motion toast also has built-in display animations and you can define its position (Bottom, Center, Top).

Installation:

To create and show a motion toast message in flutter follow the steps below:

  • > Create a flutter project
  • > Add motion_toast dependency to the project
  • > Import the motion toast package:-
import 'package: motion_toast/motion_toast.dart';
  • > Implement code for creating and showing motion toast in a flutter.

Run this command:

OR

To get motion_toast working on your project all you need to do is to add this line to your pubspec.yaml file under dependencies

Flutter Motion Toast Attributes:

1:-description the String content that will be used in the motion toast itself will be displayed to users, this parameter is required for all constructors.

MotionToast(
icon: Icons.alarm,
primaryColor: Colors.red,
description: 'this is description',
).show(context);

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

2:- title:- the title is String toast, by default, it’s an empty string for all the constructors.

MotionToast(
icon: Icons.alarm,
primaryColor: Colors.red,
description: 'this is description',
).show(context);

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

3:- descriptionStyle is the text style that will be applied to the description text.

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
descriptionStyle: TextStyle(
fontSize: 14,
color: Colors.deepOrange
),
).show(context);

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

4:- titleStyl is the text style that will be applied on the title text.

MotionToast(
primaryColor: Colors.blue,
description: "This is description",
icon: Icons.message,
title: "Message",
titleStyle: TextStyle(
fontSize: 16,
fontWeight:FontWeight.bold,
color: Colors.deepOrange
),
).show(context);

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

5:-icon is the IconData that will render in the motion toast, this parameter is required when creating a custom toast otherwise you don’t have to pass it.

MotionToast(
primaryColor: Colors.yellow,
description: "This is description",
icon: Icons.video_label,
).show(context);

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

6:-primaryColor The motion toast background color (applied on the background), this parameter is required when creating a custom toast otherwise you don’t have to pass it.

MotionToast(
icon: Icons.alarm,
primaryColor: Colors.red,
description:
'this is description',
).show(context);

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

7:-widththe width of the toast is not required & its default value is 350.

MotionToast(
primaryColor: Colors.blue,
description: "This is description",
icon: Icons.message,
width: 300,
).show(context);

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

8:-height the height of the toast & its default value is 80.

MotionToast(
primaryColor: Colors.blue,
description: "This is description",
icon: Icons.message,
width: 300,
height: 130,
).show(context);

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

9:-iconSizethis is required a double value & its default value is 40.

MotionToast(
primaryColor: Colors.yellow,
description: "This is description",
icon: Icons.message,
iconType: ICON_TYPE.CUPERTINO,
).show(context);

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

10:-iconType the style type of the icon (Cupertino or Material Design).

MotionToast(
primaryColor: Colors.red,
description: "This is description",
icon: Icons.message,
iconType: ICON_TYPE.cupertino,
).show(context);

11:-enableAnimation define whether the toast will be animated or not, by default it’s true.MotionToast(
primaryColor: Colors.yellow,
description: “This is description”,
icon: Icons.message,
enableAnimation: false,
).show(context);

12:-layoutOrientation define how the toast layout will be rendered LTR or RTL.

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
layoutOrientation: ORIENTATION.rtl,
).show(context);

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

13:-animationType the type of animation applied to the toast (From the bottom, from left, from right, from top) by default its value is from the bottom.

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
animationType: ANIMATION.fromLeft,
).show(context);

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

14:-animationDurationthe duration of the animation by default its value is Duration(milliseconds: 1500) .

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
enableAnimation: false,
animationDuration: Duration(seconds: 3),
).show(context);

15:-toastDurationthe duration the how much the toast will be shown, by default the toast takes 3 seconds.

MotionToast(
primaryColor: Colors.blue,
description: "This is description",
icon: Icons.message,
toastDuration: Duration(seconds: 3),
).show(context);

16:-animationCurvethe animation rendering curve, by default its value is Curves.ease.

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
animationCurve: Curves.bounceIn,
).show(context);

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

17:-positionthe position where the toast will be displayed (TOP, BOTTOM, CENTER).

MotionToast(
primaryColor: Colors.green,
description: "This is description",
icon: Icons.message,
position: MOTION_TOAST_POSITION.TOP,
animationType: ANIMATION.FROM_TOP,
).show(context);

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

18:-borderRadiusthe radius of the borders of the toast.

MotionToast(
primaryColor: Colors.yellow,
description: "This is description",
icon: Icons.message,
borderRadius: 20,
).show(context);

19:-onClosefunction invoked once the toast is closed.

MotionToast(
primaryColor: Colors.purple,
description: "This is description",
icon: Icons.message,
onClose: (){
print("close");
},
).show(context);

20:-dismissabledefine whether the toast can be dismissed or not (applied only on bottom motion toast).

MotionToast(
primaryColor: Colors.purple,
description: "This is description",
icon: Icons.message,
dismissable: true,
).show(context);

21:-secondaryColorSecondary color applied on the sidebar and the icon (available when using the default constructor).MotionToast(
primaryColor: Colors.purple,
description: “This is description”,
icon: Icons.message,
secondaryColor: Colors.grey,
).show(context);

22:-backgroundTypedefine the background style transparent, solid, or lighter.

MotionToast(
primaryColor: Colors.purple,
description: "This is description",
icon: Icons.message,
backgroundType: BACKGROUND_TYPE.lighter,
).show(context);

Flutter Motion Toast / Styled Toast Built-In Types:

1:-Success

MotionToast.success(
title: "Success Motion Toast",
description: "Example of success motion toast",
width: 300,
).show(context);

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

2:-Error

MotionToast.error(
title: "Error",
description: "Example of error toast"
).show(context);

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

3:-Warning

MotionToast.warning(
title: "Warning Motion Toast",
description: "This is a Warning toast "
).show(context);

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

4:-Delete

MotionToast.delete(
title: "Deleted",
description: "The item is deleted"
).show(context);

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

5:-Info

MotionToast.info(
title: "Info Motion Toast",
description: "Example of Info Toast"
).show(context);

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

Final Output:

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

Conclusion:

In this article, we discussed how this package can be used, what are all the parameters that you can use to customize the display of it, and also it provides multiple features to customize the toast.

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.

GitHub Link:

find the source code of the Motion Toast:

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


From Our Parent Company Aeologic

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

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

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

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

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


GestureDetector In Flutter

0

When it comes to creating applications, you have to handle user reactions such as touch and drags. This makes your application interactional beneficially handle gestures, you need to listen to the gestures and greet them. Flutter offers a change of widgets that help add interactivity to your apps.

In this article, we will explore the GestureDetector In Flutter. We will see how to implement a demo program to create a GestureDetector and also shows properties in your flutter applications.


Table Of Contents::

Introduction

Properties

Implementation

Conclusion

GitHub Link


Introduction:

There are many widgets in a flutter, like Container, Column, Text, etc. They don’t have a basic way of detecting gestures. Such widgets are covered in the “GestureDetector” widget which is simply used for detecting gestures and does not give any visual response like a wave effect.

It’s a widget that detects gestures. Attempts to acknowledge gestures that correspond to its non-null callbacks. If this widget has a child, it stays with that child for its sizing behavior. If it does not have a child, it fattens to fit the parent instead. By default a Gesture Detector with an unseeable child ignores touches; this behavior can be supervised with behavior. Gesture Detector also listens for accessibility events and maps them to the callbacks. To ignore availability events.

GestureDetector({
Key key,
Widget? child,
void Function(TapDownDetails)? onTapDown,
void Function(TapUpDetails)? onTapUp,
void Function()? onTap,
void Function()? onTapCancel,
void Function()? onSecondaryTap,
});

Properties:

There are some properties of GestureDetector are:

  • > child: This 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 to that widget.

Implementation:

final Widget? child;
  • onTap(): Touching the surface of the device with a fingertip for a short period and then releasing the fingertip.

Implementation:

final GestureTapCallback? onTap;
  • onTapDown(): Triggered when the user makes contact with the screen, might be a tap.

Implementation:

final GestureTapDownCallback? onTapDown;
  • onDoubleTap(): The user tapped the screen at the same location twice in quick succession.

Implementation:

final GestureTapCallback? onDoubleTap;
  • onHorizontalDragEnd(): A pointer that was previously in contact with the screen with a primary button and moving horizontally is no longer in contact with the screen and was moving at a specific velocity when it stop final GestureDragEndCallback? onHorizontalDragEnd;ped contacting the screen.

Implementation:

final GestureDragEndCallback? onHorizontalDragEnd;
  • onDoubleTapDown(): The pointer that previously triggered onDoubleTapDown will not end up causing a double-tap.

Implementation:

final GestureTapCancelCallback? onDoubleTapCancel;
  • onLongPress(): Triggered when a pointer has remained in contact with the screen at the same location for a long period.

Implementation:

final GestureLongPressCallback? onLongPress;

Implementation:

In the Gesture Detector demo, first, we take a Stateful class and create color and text variable in which we pass the initial color, the value of color is Teal and the value of the text is “Hello! it’s Teal Color”.

In BuildContext() we return Scaffold() and use the property of AppBar() and pass the title of the application. In the body of Scaffold(), we pass Center() and after that, we pass GestureDetector() as a child of it. We create a Container() and pass the color and text which is already passed the code. And use the properties of GestureDetector(), We use onTap(): onTap() is used when the user makes contact with the screen, which might be a tap.

Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepPurpleAccent,
centerTitle: true,
title: Text('Gesture Detector Demo'),
),
body: Center(
child: GestureDetector(
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(20)
),
width: 250,
height: 200,
child: Center(
child: text,
)),
),
),
);
}

In the onTap() we pass the setState() and in the setState() we pass the different colors which are Amber colors and pass the new Text “Hello! it’s Amber Color”. When we click on that container, The color, and the text will be changed.

onTap: (){
setState(() {
color = Colors.amber;
text = Text("Hello! it's Amber Color",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold
),);
});
},

After that, we use onDoubleTap(): onDoubleTap() is used when the user tapped the screen at the same location twice in quick succession. In this, we pass the setState() and in this, we pass the different color which is Blue color and pass the new Text “Hello! it’s Blue Color”. When we double click on that container, The color, and the text will be changed.

onDoubleTap: (){
setState(() {
color = Colors.blueAccent;
text = Text("Hello! it's Blue Color",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold
),);
});
},

And at last, we create onLongPress(): onLongPress() is used when a pointer has remained in contact with the screen at the same location for a long period. In this, we pass the setState() and in this, we pass the different color which is Orange color, and pass the new Text “Hello! it’s Orange Color”. When we press the container for a long time, The color and the text will be changed.

onLongPress: (){
setState(() {
color = Colors.deepOrangeAccent;
text = Text("Hello! it's Orange Color",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold
),);
});
},

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


Conclusion:

In this article, we have been through What is GestureDetector in Flutter along with how to implement it in a Flutter. By using we can perform many orations of tap or we can say we can perform different type onClick. You can use this according to your requirement.

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


GitHub Link:

find the source code of the Gesture Detector:

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


From Our Parent Company Aeologic

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

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

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

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

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


RotationTransition In Flutter

0

In this article, we will explore the RotationTransition In Flutter. We will see how to implement a demo program to create a RotationTransition box and also shows a display animation in your flutter applications.


Table Of Contents:

What is RotationTransition?

Properties

How to declare Animation for RotationTransition

How to use RotationTransition Widget in Flutter?

Rotation Transition to Rotate Anticlockwise Flutter

Conclusion

GitHub Link


What is RotationTransition?:

RotationTransition Widget is a widget that is used to animate the rotation of the widget.

Default Constructor of it will have code snippet as below:

RotationTransition({
Key? key,
required Animation turns,
Alignment alignment = Alignment.center,
FilterQuality? filterQuality,
Widget? child,
});

In Above Constructor all the attributes marked with @requuired must not be empty so in this constructor turns must not be empty.

Properties:

There are some properties of RotationTransition are:

1:-key: This attribute key controls how one widget replaces another widget in the tree.

2:-turns: This attribute has a datatype Animation that is used to control the rotation of the child.

3:-alignment: This attribute is used to define the alignment of the origin of the coordinate system around which the rotation occurs, relative to the size of the box.

4:-child: This attribute is used to define the widget below this widget in the tree.

How to declare Animation for RotationTransition:-

Firstly we have to extend the TickerProviderStateMixin.

extends State<Rotation> with TickerProviderStateMixin{

After that we have to declare the variables

late AnimationController _controller;
late Animation<double> _animation;

And then we have to initialize those variables in a initState()

void initState() {

// TODO: implement initState
super.initState();
_controller=AnimationController(vsync:this,duration: Duration(seconds: 10));
_animation=CurvedAnimation(parent: _controller, curve: Curves.easeIn,);
_controller.repeat();
}

After initialization, we have to dispose of the animation controller because This reduces the likelihood of leaks. When used with a StatefulWidget, it is common for an AnimationController to be created in the State. initState method and then disposed in the State.

void dispose() {
_controller.dispose();
// TODO: implement dispose
super.dispose();
}

How to use RotationTransition Widget in Flutter?:

The following code will show you how to make use of the RotationTransition Widget.

class _RotationState extends State<Rotation> with TickerProviderStateMixin{ late AnimationController _controller;
late Animation<double> _animation;@override
void initState() {

// TODO: implement initState
super.initState();
_controller=AnimationController(vsync:this,duration: Duration(seconds: 10));
_animation=CurvedAnimation(parent: _controller, curve: Curves.easeIn,);
_controller.repeat();
}
@override
void dispose() {
_controller.dispose();
// TODO: implement dispose
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RotationTransition(turns: turnsTween.animate(_controller),,
child: Center(child: Image.network('assets/img/squarebox.png',height: 200,width: 200,))),
],
),
),

);
}
}

In this RotationTransition constructor has turned as a parameter that takes animation as a value, and in animation, we can use multiple curves like easeIn, ease, bounceIn, bounceInOut, bounceOut, decelerate, easeInCubic, and many more types.

_controller=AnimationController(vsync:this,duration: Duration(seconds: 10));
_animation=CurvedAnimation(parent: _controller, curve: Curves.easeIn,);

Just changes curves you can see multiple type & by duration, you can decide how much time the animation will work. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Rotation Transition to Rotate Anticlockwise Flutter:

When the widget rotates clockwise controller’s value goes from 0.0 to 1.0. To rotate in the opposite direction you need value to go from 1.0. to 0.0.To achieve that, you can set up Tween:

final Tween<double> turnsTween = Tween<double>(
begin: 1,
end: 0,
);

We have to declare Tween which will provide us the starting & ending value

RotationTransition(turns: turnsTween.animate(_controller),,
child: Center(child: Image.network('assets/img/squarebox.png',height: 200,width: 200,))),

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

Conclusion:

In this article, we discussed how this RotationTransition is being used, what are all the parameters that you can use to customize the display of it, and also it provides multiple features to customize the widget.

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.

GitHub Link:

find the source code of the RotationTransition:

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


From Our Parent Company Aeologic

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

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

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

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

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


ClipOval Widget In Flutter

0

In any good app, images are one of the key essentials. Image handling has always been a tricky part for developers. Developers always want some sort and easy method to handle the shape and size of the image. Flutter has come up with a very quick fix for this issue we face with a very handy Widget.

In this blog, I’ll be taking you through the overview, usage, and implementation of a widely popular widget known as ClipOval.


Table Of Contents:

What is ClipOval?

Constructor

Properties

Code implementation

Code Files

Conclusion


What is ClipOval?:

ClipOval is a widget that can be used to wrap any image into circular or oval form. It does not matter whether the image is square, rectangular, or any other shape. The size and location of a clip oval can be customized using child class.

The ClipOval widget does have some standard rules which it follows while its application on images for an eg a square image will be converted into a circular image, an image having any dimensions longer than the counterpart will be elongated into that direction. However, the shape will remain oval.

Constructor:

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

const ClipOval({Key? key, this.clipper,
this.clipBehavior = Clip.antiAlias,
Widget? child})
: assert(clipBehavior != null),
super(key: key, child: child);

Properties:

  • > Child-This property is used to define the parent builder widget under which it is being passed.
  • > ClipBehaviour– It controls the clipping behavior of the ClipOval widget on which it has been passed to. It must not be set to null or clip. none. There is further three behavior that can be passed under this property.

➤ Clip.hardEdge

➤ Clip.antiAlias

➤ Clip.antiAliasWithSaveLayer

  • > CustomClipper<Rect>? Clipper– If it has been passed as non-null then it determines which clip should be used. It is used to create custom-shaped clipped images. We can pass dimensions as per our requirements.

Code Implementation:

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

After which we will create a class inside the main.dart file.First, we will try to implement the ClipOval widget in its default form that means we won’t be using the custom clipper.

class _DemoPageState extends State<DemoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Devs'),
backgroundColor: Colors.blue,
),
body: Center(
child: ClipOval(
child: Image.network(
'https://images.unsplash.com/photo-1561731216-c3a4d99437d5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxleHBsb3JlLWZlZWR8MXx8fGVufDB8fHx8&w=1000&q=80',
fit: BoxFit.fill),
),
),
backgroundColor: Colors.lightBlue[50],
);
}
}

Here we are simply creating a new class and then passing the image in the scaffold widget. To get the desired oval shape we have wrapped the image in ClipOval.

Now we will try the same image using a custom clipper in the below code. For doing this we will create a custom clipper method in a whole new class. We will extend the class to Customclipper<Rect>.

class MyClip extends CustomClipper<Rect>

To make sure that our clipper works as per our requirement we will pass two methods getClip and shouldReclip.

class MyClip extends CustomClipper<Rect> {
Rect getClip(Size size) {
return Rect.fromLTWH(50, 0, 300, 300);
}

bool shouldReclip(oldClipper) {
return false;
}
}

The getClip method takes the size of the child and returns to Rect into which flutter will draw the oval. Also, you can place this Rect anywhere and give it any size as per your requirement regardless of the child’s size.

The second method is just a cross-check for flutter to check whether there is any need to clip the image again or not. It takes the boolean value as a return argument. Normally we should return it as false as we have already met the requirement in the getClip method we created.

Code Files:

import 'package:flutter/material.dart';

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

class DemoApp extends StatelessWidget {
// This widget is
//the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ClipOval',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: DemoPage(),
debugShowCheckedModeBanner: false,
);
}
}

class DemoPage extends StatefulWidget {
@override
_DemoPageState createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Devs'),
backgroundColor: Colors.blue,
),
body: Center(
child: ClipOval(
child: Image.network(
'https://images.unsplash.com/photo-1561731216-c3a4d99437d5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxleHBsb3JlLWZlZWR8MXx8fGVufDB8fHx8&w=1000&q=80',
fit: BoxFit.fill),
clipper: MyClip(),
),
),
backgroundColor: Colors.lightBlue[50],
);
}
}

class MyClip extends CustomClipper<Rect> {
Rect getClip(Size size) {
return Rect.fromLTRB(0, 100, 100, 100);
}

bool shouldReclip(oldClipper) {
return false;
}
}

Conclusion:

In the end, clipOval is a widget that can be quite handy while dealing with images. We don’t have to go through the inner structures of the code and worry about shape and size. Rather we can directly import this widget and acquire our desired dimensions.

Thanks for reading the entire article. It was just a small overview of the clipOval widget its functionality and implementation. I hope the time you spent reading this article turns out to be productive. You can try implementing and modifying this code as per your needs. Feel free to reach out to me for any suggestions or corrections where I can improve.

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

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

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

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

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

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


GetX In Flutter

0

In this article, we will explore GetX In Flutter. We will see how to implement a demo program using GetX and show you how easily we can do everything in the application.


Table Of Contents:

About Getx

installation

Features of Getx

Conclusion

GitHub Link


About GetX:

GetX is an extra-light and powerful solution for flutter by using getx we can easily manage routing, states and can efficiently perform dependency injection.

If we use GetX then we can not have to use the StatefulWidgets, it can surely reduce some RAM consumption, no need to use the initState() and other such methods which are used in StatefulWidgets.

GetX has 3 basic principles. This means that these are the priority for all resources in the library:

1:-PERFORMANCE: it is focused on performance and minimum consumption of resources. it does not use Streams or ChangeNotifier.

2:-PRODUCTIVITY: it has an easy syntax that can easily remember. No matter what you want to do, there is always an easier way with GetX. It will save hours of development and will provide the maximum performance your application can deliver.

3:-ORGANIZATION: it allows us to do away with business logic on views and separate dependency injection and navigation from the UI. You don’t require the context to navigate between screens.

Installation :

Add Get to your package’s pubspec.yaml file:

dependencies:
get: ^4.6.1

Import it in a file that it will be used:

import 'package:get/get.dart';

Features Of GetX:

GetX has multiple features you will need in your daily app development in Flutter:

> State Management

Get has two different state managers:

1:-Simple state manager (known as GetBuilder).

The Simple state Management uses extremely low resources since it does not use Streams or ChangeNotifier. But your widgets can listen to changes of your state, we use the update() method.

import 'package:get/get.dart';
class CounterController extends GetxController {
var counter = 0;
increment() {
counter++;
update();
} }

After doing some changes to your state in your controller, you have to call the update method to notify the widgets, which are listening to the state. As you can see, we have to simply declare the state of the variable as we normally do. So, you don’t need to transform your state variables into something else.

2:-Reactive state manager (known as GetX/Obx).

Reactive State Management: In this, we’ll not able to use streams for this we have to use GetX class. syntax of GetX is very similar to GetBuilder. GetX has all the required Reactive Programming features we don’t need to use StreamControllers, StreamBuilders for each variable, and class for each state, even we do not need to use any auto-generated classes by code generators.

Let’s imagine that you have a named variable and want that every time you change it, all widgets that use it are automatically changed.

This is a count variable:

var name = 'Jonatas Borges';

To make it observable, you just need to add “.obs” to the end of it:

var name = 'Jonatas Borges'.obs;

And in the UI, when you want to show that value and update the screen whenever the values change, simply do this:

Obx(() => Text("${controller.name}"));

> Route Management

GetX provides API for navigating within the Flutter application. This API is simple and with less code needed.
in the old way, we can use this

Navigator.push(context, MaterialPageRoute(builder: (context)=>Profile()));

but in getx, we can simply navigate through this// Before:

MaterialApp(
GetMaterialApp(
home: MyHome(),
)Get.to(Profile());
Get.toNamed('/profile');
Get.back();
Get.off(Profile());
Get.offAll(Profile());

> Dependency Management

it provides a smart way to manage dependencies in your Flutter application like the view controllers. GetX will remove any controller not being used at the moment from memory. This was a task you as the developer will have to do manually but GetX does that for you automatically out of the box.

Controller controller = Get.put(Controller());

if you navigate through multiple routes, and you require data that was left behind in your controller, you would need a state manager combined with the Provider or Get_it, correct? Not with Get. You just need to ask to Get to “find” for your controller, you don’t need any additional dependencies:

Controller controller = Get.find();

And then you will be able to recover your controller data that was obtained:

Text(controller.textFromApi);

> Internationalization

Internationalization is an activity that developers, perform and it provides the multiple language support feature in an application.
GetX provides API for navigating within the Flutter application. This API is simple and with less code needed.

import 'package:get/get.dart';

class Messages extends Translations {
@override
Map<String, Map<String, String>> get keys => {
'en_US': {
'hello': 'Hello World',
},
'de_DE': {
'hello': 'Hallo Welt',
}};}

Using translations

Just append .tr to the specified key and it will be translated, using the current value of Get.locale and Get.fallbackLocale.Text(‘title’.tr);

Using translation with singular and plural

var products = [];
Text('singularKey'.trPlural('pluralKey', products.length, Args));

Using translation with parameters

import 'package:get/get.dart';

Map<String, Map<String, String>> get keys => {
'en_US': {
'logged_in': 'logged in as @name with email @email',
},
'es_ES': {
'logged_in': 'iniciado sesión como @name con e-mail @email',
}
};

Text('logged_in'.trParams({
'name': 'Jhon',
'email': 'jhon@example.com'
}));

Locales

Pass parameters to GetMaterialApp to define the locale and translations.

return GetMaterialApp(
translations: Messages(), // your translations
locale: Locale('en', 'US'), // translations will be displayed in that locale
fallbackLocale: Locale('en', 'UK'), // specify the fallback locale in case an invalid locale is selected.
);

Change locale

var locale = Locale('en', 'US');
Get.updateLocale(locale);

> Change Theme

While we are using GetX we don’t need to use any higher level widget than GetMaterialApp.

You can create your custom theme and simply add it within Get.changeTheme without any boilerplate for that:

Get.changeTheme(ThemeData.light());

> GetConnect

GetConnect is an easy way to communicate from your back to your front with HTTP or WebSockets.

Default configuration

You can simply extend GetConnect and use the GET/POST/PUT/DELETE/SOCKET.

class UserProvider extends GetConnect {
// Get request
Future<Response> getData() => get('url');
// Post request
Future<Response> postData(Map data) => post('Url', body: data);
}

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

Conclusion:

In this article, we discussed how this GetX is being used, what are all the features provided by Getx also you can use to minimize the ram consumption, and also it provides multiple features that minimize our work.

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


GitHub Link:

find the source code of the Getx:

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


From Our Parent Company Aeologic

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

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

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

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

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


SQFlite In Flutter

0

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


Table Of Contents::

Introduction

AddDependency

Create Database

Create Model Class

CURD Operations

Implementation

Conclusion

GitHub Link


Introduction:

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


Add Dependency:

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

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

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


Create Database:

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

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

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

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

Create Model Class:

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

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

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

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


CURD Operations:

> Create:

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

rawInsert:

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

Insert:

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

> Read:

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

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

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

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

> Update:

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

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

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

> Delete:

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

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

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

Implementation:

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

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

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

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

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

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

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

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

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

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

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

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

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

Widget editButton() => IconButton(

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

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

refreshNote();
});

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

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

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

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


Conclusion:

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

❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


GitHub Link:

Find the source code of the SQFlite In Flutter :

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


From Our Parent Company Aeologic

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

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

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

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

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


Linear Progress Indicator In Flutter

0

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

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

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


Table Of Contents:

What is Linear Progress Indicator?

Types

Constructor

Properties

Code implementation

Code Files

Conclusion


What is Linear Progress Indicator?

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


Types:

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

Constructor:

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

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

Properties:

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

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

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

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

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

> Semantic Label: Used to add a semantic label.

> Semantic Value: Used to add Semantic value.

Code Implementation:

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

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

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

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

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

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

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

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

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

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

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

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

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

Code Files:

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

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

Conclusion:

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

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

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

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

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

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

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

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


A/B Testing In Flutter

0

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

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


Table Of Contents:

Benefits of A/B Testing

When to use A/B Testing

How to Do A/B Testing

Why you should A/B Testing

Firebase Remote Config

Implementation

Conclusion

GitHub Link


Benefits of A/B Testing:

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

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

When to use A/B testing:

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

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

How to Do A/B Testing:

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

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

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

Why you should A/B Testing:

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

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


Firebase Remote Config:

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


Setting up Remote Config and AB testing:

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

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

Implementation:

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

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

and add the parameter here:

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

dependencies:
flutter:
sdk: flutter

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

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

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

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

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

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

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

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

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


Conclusion

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


GitHub Link:

find the source code of the Positioned Transition Widget:

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


From Our Parent Company Aeologic

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

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

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

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

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


Convex Bottom Bar In Flutter

0

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


Table Of Contents:

Introduction

Add Dependency

How to Use

Features

Properties

Implementation

Conclusion

GitHub Link


Introduction:

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

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


Add Dependency:

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

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

we use convax_bottom_bar for a better bootom_bar UI.


How to Use:

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

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

Features:

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

Properties:

There are some properties of Convex_Bottom_Bar are:

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

Implementation:

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

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

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

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

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

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

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

Home Screen:

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

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

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

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

Favorite Screen:

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

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

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

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

CartPage Screen:

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

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

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

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

ProfilePage Screen:

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

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

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

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

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


Conclusion:

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

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.

GitHub Link:

Find the source codeof the Convex Bottom Bar:

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


From Our Parent Company Aeologic

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

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

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

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

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