Google search engine
Home Blog Page 25

Explore Expansion Tile Card In Flutter

0

A solitary line ListTile with the trailing button expands or collapses the tile to uncover or conceal the children. This widget is normally utilized with ListView to make an “expand/collapse” list section. When utilized with looking over widgets like ListView, an interesting PageStorageKey should be indicated to empower the ExpansionTileCard to save and reestablish its expanded state when it is scrolled all through see.

In this article, we will explore the Expansion Tile Card In Flutter. We will be implementing a demo program of the Expansion Tile Card using the expansion_tile_card package in your flutter application by building a simple flutter application.

expansion_tile_card | Flutter Package
An “expansion” on the Flutter SDK’s standard ExpansionTile, to create a Google Material Theme inspired raised widget…pub. dev

Table Of Contents::

Expansion Tile Card

Properties

Implementation

Code Implement

Code File

Conclusion



Expansion Tile Card:

The Expansion Tile Card works comparably to that of the Flutter SDK’s standard expansion tile. However, it utilizes the style utilized by Google itself in its items to raise a tile. It very well may be known as a better version of Flutter’s ExpansionTileCard.

Demo Module :

This demo video shows how to create an Expansion Tile Card in a flutter. It shows how the Expansion Tile Card will work using the expansion_tile_card package in your flutter applications. It shows a card; when the user taps a drop-down button, then expanded the card. It will be shown on your device.

Properties:

There are some property of Expansion Tile Card are:

  • > shadowColor: This property was the color of the shadow of the card.
  • > initiallyExpanded: This property specified if the list tile is initially expanded (true) or collapsed (false, the default).
  • > baseColor: This property was the background color of the unexpanded tile. If null, defaults to Theme.of(context).canvasColor.
  • > expandedColor: This property was the background color of the expanded card. If null, defaults to Theme.of(context).cardColor.
  • > colorCurve: This property was the animation curve used to control the header, icon, and material colors. Defaults to Curves.easeIn.
  • > paddingCurve: This property was the animation curve used by the expanding/collapsing padding. Defaults to Curves.easeIn.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

expansion_tile_card: 

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/images/

Step 3: Import

import 'package:expansion_tile_card/expansion_tile_card.dart';

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

Step 5: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

Create a new dart file called expansion_tile_card_demo.dartinside the lib folder.

final GlobalKey<ExpansionTileCardState> cardA = new GlobalKey();

First, we will create a globalkey in the bracket we will add an ExpansionTileCardState, add your key name is equal to the new globalkey().

ExpansionTileCard(
baseColor: Colors.cyan[50],
expandedColor: Colors.red[50],
key: cardA,
leading: CircleAvatar(
child: Image.asset("assets/images/devs.jpg")),
title: Text("Flutter Dev's"),
subtitle: Text("FLUTTER DEVELOPMENT COMPANY"),
children: <Widget>[
Divider(
thickness: 1.0,
height: 1.0,
),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8.0,
),
child: Text(
"FlutterDevs specializes in creating cost-effective and efficient applications with our perfectly crafted,"
" creative and leading-edge flutter app development solutions for customers all around the globe.",
style: Theme.of(context)
.textTheme
.bodyText2
.copyWith(fontSize: 16),
),
),
),
],
),

In the body, we will add ListView(). Inside ListView, we will add ExpansionTileCard(). Inside ExpansionTileCard, we will add the card’s baseColor, add an expandedColor of the card, add a key, add a leading property. In this property, we will add a CircleAvatar() for the image. Now, we will add a title, subtitle, and add children. In the children widget, we will add a divider and text. Wrapped the text to align. The alignment was center. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Unexpanded Card

Now, we will add ButtonBar() in ExpansionTileCard().

ButtonBar(
alignment: MainAxisAlignment.spaceAround,
buttonHeight: 52.0,
buttonMinWidth: 90.0,
children: <Widget>[
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
cardA.currentState?.expand();
},
child: Column(
children: <Widget>[
Icon(Icons.arrow_downward),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Open'),
],
),
),
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
cardA.currentState?.collapse();
},
child: Column(
children: <Widget>[
Icon(Icons.arrow_upward),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Close'),
],
),
),
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
},
child: Column(
children: <Widget>[
Icon(Icons.swap_vert),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Toggle'),
],
),
),
],
),

In ButtonBar, we will add three FlatButtons. We will add the text ”open,” add down arrow icon, and onPressed() on the first button. All button shape was the rounded rectangular border. On the second button, we will add the text ”close,” add up arrow icon, and onPressed(). On the last button, we will add the text ”toggle,” add swap icon, and onPressed(). When we run the application, we ought to get the screen’s output like the underneath screen capture.

Expanded Card

When the user taps the drop-down arrow, then expanded the card. When the user taps the close icon, then collapsed the card and also changed the color in the expanded/collapsed card.

CodeFile:

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

class ExpansionTileCardDemo extends StatefulWidget {

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

class _ExpansionTileCardDemoState extends State<ExpansionTileCardDemo> {
final GlobalKey<ExpansionTileCardState> cardA = new GlobalKey();

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text('ExpansionTileCard Demo'),
),
body: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0,vertical: 20),
child: ExpansionTileCard(
baseColor: Colors.cyan[50],
expandedColor: Colors.red[50],
key: cardA,
leading: CircleAvatar(
child: Image.asset("assets/images/devs.jpg")),
title: Text("Flutter Dev's"),
subtitle: Text("FLUTTER DEVELOPMENT COMPANY"),
children: <Widget>[
Divider(
thickness: 1.0,
height: 1.0,
),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8.0,
),
child: Text(
"FlutterDevs specializes in creating cost-effective and efficient applications with our perfectly crafted,"
" creative and leading-edge flutter app development solutions for customers all around the globe.",
style: Theme.of(context)
.textTheme
.bodyText2
.copyWith(fontSize: 16),
),
),
),
ButtonBar(
alignment: MainAxisAlignment.spaceAround,
buttonHeight: 52.0,
buttonMinWidth: 90.0,
children: <Widget>[
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
cardA.currentState?.expand();
},
child: Column(
children: <Widget>[
Icon(Icons.arrow_downward),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Open'),
],
),
),
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
cardA.currentState?.collapse();
},
child: Column(
children: <Widget>[
Icon(Icons.arrow_upward),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Close'),
],
),
),
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0)),
onPressed: () {
},
child: Column(
children: <Widget>[
Icon(Icons.swap_vert),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
),
Text('Toggle'),
],
),
),
],
),
],
),
),
],
),
);
}
}

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Expansion Tile Card in your flutter projectsWe will show you what the Expansion Tile Card is?. Some expansion tile card properties, make a demo program for working Expansion Tile Card and show a card when the user taps a drop-down button, then expanded it. When the user taps the closed button, then the card was collapsed using the expansion_tile_card 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.

find the source code of the Flutter Expansion Tile Card Demo:

flutter-devs/flutter_expansion_tilte_card_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


SlimyCard Animated In Flutter

Very much designed animations cause a UI to feel more instinctive, add to the slick look and feel of a polished application, and improve the user experience. Flutter’s animation support makes it easy to actualize an assortment of animation types. Numerous widgets, especially Material widgets, accompany the standard movement effects characterized in their design spec, but at the same time, it’s possible to customize these effects.

In this blog, we will explore the SlimyCard Animated In Flutter. We will see how to implement slimy card animated using the slimy_card package in your flutter applications.

slimy_card | Flutter Package
SlimyCard provides a beautiful slime-like animation of a Card that separates into two different Cards, one at the top…pub.dev

Table Of Contents ::

SlimyCard

Attributes

Implementation

Code Implement

Code File

Conclusion



SlimyCard:

SlimyCard provides a wonderful slime-like animation of a Card that separates into two various Cards, one at the top and another at the bottom. It is possible to place any custom widget in these two separate cards.

Demo Module :

This demo video shows how to create a slimy card in a flutter. It shows how the slimy card will work using the slimy_card package in your flutter applications. It shows an animation of a card that separates into two different cards open. It will be shown on your device.

Attributes:

There are some attributes of the slimy card are:

  • > color: These attributes mean the user adds any color they want.
  • > width: These attributes mean the width must be at least 100.
  • > topCardHeight: These attributes mean the height of the Top Card must be at least 150.
  • > bottomCardHeight: These attributes mean the height of the Bottom Card must be at least 100.
  • > borderRadius: These attributes mean the border-radius must neither exceed 30 nor be negative.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

slimy_card: ^1.0.4

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/images/

Step 3: Import

import 'package:slimy_card/slimy_card.dart';

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

Step 5: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

StreamBuilder(
initialData: false,
stream: slimyCard.stream,
builder: ((BuildContext context, AsyncSnapshot snapshot) {
return ListView(
padding: EdgeInsets.zero,
children: <Widget>[
SizedBox(height: 70),
SlimyCard(
color: Colors.indigo[300],
topCardWidget: topCardWidget((snapshot.data)
? 'assets/images/devs.jpg'
: 'assets/images/flutter.png'),
bottomCardWidget: bottomCardWidget(),
),
],
);
}),
),

In the body, we will add a StreamBuilder(). In StreamBuilder, we will add an initialData; SlimyCard supports the Streams(BLoC) to provide its real-time status. For that, wrap SlimyCard in a StreamBuilder, and in its `stream` property, assign `slimyCard.stream`. Its snapshot will contain the status. In SlimyCard, we will add color, topCardWidget, and bottomCardWidget. We will below describe the code.

Now, we will deeply describe topCardWidget() function:

In the topCardWidget, we will add a column widget. Inside the column, we will add a container widget. In the container, we will add a height, width, and decorationImage. We will also add two texts and wrap them to the center.

Widget topCardWidget(String imagePath) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: 70,
width: 70,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(image: AssetImage(imagePath)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 20,
spreadRadius: 1,
),
],
),
),
SizedBox(height: 15),
Text(
'Flutter',
style: TextStyle(color: Colors.white, fontSize: 20),
),
SizedBox(height: 15),
Center(
child: Text(
'Flutter is Google’s UI toolkit for building beautiful, natively compiled applications'
' for mobile, web, and desktop from a single codebase.',
style: TextStyle(
color: Colors.white.withOpacity(0.8),
fontSize: 12,
fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
),
),
SizedBox(height: 10),
],
);
}

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

topCardWidget

Now, we will deeply describe bottomCardWidget() function:

In the bottomCardWidget, we will return the column. In the column, we will add two texts and wrap them to the center. When the user taps the drop-down button, the bottomCardWidget will be animated and shown on your devices.

Widget bottomCardWidget() {
return Column(
children: [
Text(
'https://flutterdevs.com/',
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
SizedBox(height: 15),
Expanded(
child: Text(
'FlutterDevs specializes in creating cost-effective and efficient '
'applications with our perfectly crafted,creative and leading-edge '
'flutter app development solutions for customers all around the globe.',
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
),
],
);
}

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

bottomCardWidget

Code File:

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

class SlimyCardDemo extends StatefulWidget {
@override
_SlimyCardDemoState createState() => _SlimyCardDemoState();
}

class _SlimyCardDemoState extends State<SlimyCardDemo> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.brown[100],
appBar: AppBar(
backgroundColor: Colors.indigo[300],
automaticallyImplyLeading: false,
title: Text("SlimyCard Animated Demo"),
),
body: StreamBuilder(
initialData: false,
stream: slimyCard.stream,
builder: ((BuildContext context, AsyncSnapshot snapshot) {
return ListView(
padding: EdgeInsets.zero,
children: <Widget>[
SizedBox(height: 70),
SlimyCard(
color: Colors.indigo[300],
topCardWidget: topCardWidget((snapshot.data)
? 'assets/images/devs.jpg'
: 'assets/images/flutter.png'),
bottomCardWidget: bottomCardWidget(),
),
],
);
}),
),
);
}

Widget topCardWidget(String imagePath) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: 70,
width: 70,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(image: AssetImage(imagePath)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 20,
spreadRadius: 1,
),
],
),
),
SizedBox(height: 15),
Text(
'Flutter',
style: TextStyle(color: Colors.white, fontSize: 20),
),
SizedBox(height: 15),
Center(
child: Text(
'Flutter is Google’s UI toolkit for building beautiful, natively compiled applications'
' for mobile, web, and desktop from a single codebase.',
style: TextStyle(
color: Colors.white.withOpacity(0.8),
fontSize: 12,
fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
),
),
SizedBox(height: 10),
],
);
}

Widget bottomCardWidget() {
return Column(
children: [
Text(
'https://flutterdevs.com/',
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
SizedBox(height: 15),
Expanded(
child: Text(
'FlutterDevs specializes in creating cost-effective and efficient '
'applications with our perfectly crafted,creative and leading-edge '
'flutter app development solutions for customers all around the globe.',
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
),
],
);
}
}

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the SlimyCard Animated in your flutter projectsWe will show you what the SlimyCard is?. Some slimycard attributes, make a demo program for working SlimyCard and show a beautiful animation of a Card that separates into two different Cards, one at the top and then another at the bottom using the slimy_card 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.

find the source code of the Flutter SlimyCard Animated Demo:

flutter-devs/flutter_slimycard_animated_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Stacked Card Carousel In Flutter

0

As mobile application developers, we sometimes need to make sliding, animated, background image carousels. Yet, sometimes, we need to make a sliding card carousel that contains information with various background colors, images, or gradients.

A material design card is a board with marginally adjusted corners and an elevation shadow. A card is a sheet of material used to represent some connected data, such as an album, a geographical location, a meal, contact details, etc.

In this blog, we will explore the Stacked Card Carousel In Flutter. We will also implement a demo program and learn to create a stacked card with a vertical carousel using the stacked_card_carousel package in your flutter applications.

stacked_card_carousel | Flutter Package
A widget for creating a vertical carousel with stacked cards. Import package in your file import…pub. dev

Table Of Contents::

Introduction

Attributes

Implementation

Code Implement

Code File

Conclusion



Introduction:

A widget for creating a vertical carousel with stacked cards. Below demo video shows how to create a stacked card with a vertical carousel in a flutter. It shows how the stacked card carousel will work using the stacked_card_carousel package in your flutter applications. It shows a list of vertical carousel sliding cards, and all cards swipe upward and stack that’s called stacked card carousel. It will be shown on your device.

Demo Module :


Attributes:

Some attribute of the stacked card carousel are:

  • > items: These attributes mean a list of card widgets.
  • > initialOffset: These attributes mean initial vertical top offset for cards.
  • > spaceBetweenItems: These attributes mean vertical space between items. Value starts from the top of the first item.
  • > applyTextScaleFactor: These attributes mean if set to true scales up space and position linearly according to the text scale factor. Scaling down is omitted.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

stacked_card_carousel: 

Step 2: Import

import 'package:stacked_card_carousel/stacked_card_carousel.dart';

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

Step 4: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

First, we will take three construction ‘title,’ ‘description’ in the string, and ‘image’ in the image format and called the class on the stacked_card_demo page.

final Image image;
final String title;
final String description;

const StyleCard({
Key key,
this.image,
this.title,
this.description
}) : super(key: key);

We will make a card widget. Inside the card, we will add an elevation property and add a column widget. In the column widget, we will add a container for the image, add a title and description. Then called the card on the stacked_card_demo page.

Card(
elevation: 4.0,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width*0.7,
height: MediaQuery.of(context).size.width*0.65,
child: image,
),
SizedBox(height: 5,),
Text(
title,
style: TextStyle(color: Colors.pinkAccent,fontSize: 22,fontWeight: FontWeight.bold),
),
SizedBox(height: 10,),
Text(
description,
style: TextStyle(color: Colors.black),textAlign: TextAlign.center,
),

],
),
),
);

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

StackedCardCarousel(
initialOffset: 40,
spaceBetweenItems:400 ,
items: styleCards,
),

In the body, we will be called StackedCardCarousel(). Inside we will add initialOffset means is initial vertical top offset for cards, spaceBetweenItems means is vertical space between items. Value starts from the top of the first item. Choose a value that is related to your card size. And the last we will add an item that means the list of card widgets.

Stacked Card Carousel

Now, we will create a list styleCards and inside add a StyleCard() class.

final List<Widget> styleCards = [
StyleCard(
image: Image.asset("assets/deepak.jpg"),
title: "Team Leader",
description: "It play extremely important role in motivating\nour team and ensuring their success.",
),
StyleCard(
image: Image.asset("assets/yashwant.png"),
title: "Secondary Team Leader ",
description: "It provides guidance, instruction, direction to\nour team. Handsome member in our team.",

),
StyleCard(
image: Image.asset("assets/akshay.png"),
title: "Software Engineer",
description: "Team player, hard worker, expert in\n both andriod and flutter",

),
StyleCard(
image: Image.asset("assets/aditya.png"),
title: "Software Engineer",
description: "Smart, quick learner, and very\ndedicated to the work.",

),
StyleCard(
image: Image.asset("assets/naveen.png"),
title: "Associate Software Engineer",
description: "Flutter developer, keen learner\n very supporting. Bodyguard of our team",
),
StyleCard(
image: Image.asset("assets/mohit.png"),
title: "Associate Software Engineer",
description: "Responsible team member,situation handler,\nand a sharp learner with flutter and blogs.",
),
StyleCard(
image: Image.asset("assets/shaiq.png"),
title: "Associate Software Engineer",
description: "Flutter developer with a passion for learning,\nstar blogger, punctual and \na handsome teammate.",
),
StyleCard(
image: Image.asset("assets/rakhi.png"),
title: "Associate Software Engineer",
description: "Newest team member, with high passion for\nlearning very sharp,and dedicated.Need more\ntime to know about you.",
),
];

We will create an eight-style card and inside add an image, title, and description. Add all data on StackedCardCarousel(). When the code run, you will saw a list of cards. When the user swipes up in vertical carousel format only, all cards will overlap and stack into another called a stacked card carousel; when the user swipes down all up cards in vertical format, then all cards back to the original position. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Card Stack

Code File :

import 'package:flutter/material.dart';
import 'package:flutter_stacked_card_carousel/style_card.dart';
import 'package:stacked_card_carousel/stacked_card_carousel.dart';

class StackedCardDemo extends StatefulWidget {

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

class _StackedCardDemoState extends State<StackedCardDemo> {
final List<Widget> styleCards = [
StyleCard(
image: Image.asset("assets/deepak.jpg"),
title: "Team Leader",
description: "It play extremely important role in motivating\nour team and ensuring their success.",
),
StyleCard(
image: Image.asset("assets/yashwant.png"),
title: "Secondary Team Leader ",
description: "It provides guidance, instruction, direction to\nour team. Handsome member in our team.",

),
StyleCard(
image: Image.asset("assets/akshay.png"),
title: "Software Engineer",
description: "Team player, hard worker, expert in\n both andriod and flutter",

),
StyleCard(
image: Image.asset("assets/aditya.png"),
title: "Software Engineer",
description: "Smart, quick learner, and very\ndedicated to the work.",

),
StyleCard(
image: Image.asset("assets/naveen.png"),
title: "Associate Software Engineer",
description: "Flutter developer, keen learner\n very supporting. Bodyguard of our team",
),
StyleCard(
image: Image.asset("assets/mohit.png"),
title: "Associate Software Engineer",
description: "Responsible team member,situation handler,\nand a sharp learner with flutter and blogs.",
),
StyleCard(
image: Image.asset("assets/shaiq.png"),
title: "Associate Software Engineer",
description: "Flutter developer with a passion for learning,\nstar blogger, punctual and \na handsome teammate.",
),
StyleCard(
image: Image.asset("assets/rakhi.png"),
title: "Associate Software Engineer",
description: "Newest team member, with high passion for\nlearning very sharp,and dedicated.Need more\ntime to know about you.",
),
];

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text('Stacked Card Carousel Demo'),
),
body: StackedCardCarousel(
initialOffset: 40,
spaceBetweenItems:400 ,
items: styleCards,
),
);
}
}

Conclusion :

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

I hope this blog will provide you with sufficient information on Trying up the Stacked Card Carousel in your flutter projectsWe will show you what the Stacked Card Carousel is?. Make a demo program for working Stacked Card Carousel and show all the cards will be a swipe up in vertical carousel format, then all cards will be overlap and stack into another 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.

find the source code of the Flutter Stacked Card Carousel Demo:

flutter-devs/flutter_stacked_card_carousel_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Folding Cell In Flutter

The animation is a complex strategy in any mobile application. Disregarding its complexity, Animation improves the user experience to another level and gives rich user interaction. Because of its extravagance, animation turns into a basic part of current mobile applications. Flutter framework perceives the significance of Animation and gives a straightforward and natural structure to build up a wide range of animations.

In this blog, we will explore the Folding Cell In Flutter. We will also implement a demo program and learn to create flutter folding cells using the folding_cell package in your flutter applications.

folding_cell | Flutter Package
Simple folding cell widget implemented in Flutter. It’s a widget so add it to any container widget as a child. Add…pub.dev

Table Of Contents::

Folding Cell

Implementation

Code Implement

Code File

Conclusion



Folding Cell:

Folding cells are the animations that appear as though a few animations when we open another/new folder, it would seem that the opened folder will be closed. Straightforward folding cell widget executed in Flutter. It’s a widget so add it to any container widget as a child.

Demo Module :

This demo video shows how to create a folding cell in a flutter. It shows how folding cells will work using the folding_cell package in your flutter applications. It shows folding cells are in listview and animations when we open a new folder and closed the opened folder. It will be shown on your device.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

google_fonts: 
folding_cell:

Step 2: Import

import 'package:folding_cell/folding_cell.dart';
import 'package:google_fonts/google_fonts.dart';

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

Step 4: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

List<TechnologyModel> _technologyList;

@override
void initState() {
// TODO: implement initState
super.initState();
_technologyList = [
TechnologyModel(title: "Application Development",
),
TechnologyModel(title: "Research & Development",
),
TechnologyModel(title: "Big Data & Analytics",
),
TechnologyModel(title: "Support Services",
),
TechnologyModel(title: "QA & Software Testing",
),

];

}

First, we will create a list _technologyList and define it on the initState() method.

Container(
child: ListView.builder(
itemCount: _technologyList.length,
itemBuilder: (context, index) {
return SimpleFoldingCell(
frontWidget: _buildFrontWidget(index),
innerTopWidget: _buildInnerWidget(index),
innerBottomWidget: _buildInnerBottomWidget(),
cellSize: Size(MediaQuery.of(context).size.width, 125),
padding: EdgeInsets.all(15),
animationDuration: Duration(milliseconds: 200),
borderRadius: 10,
onOpen: () => print('$index cell opened'),
onClose: () => print('$index cell closed'),
);
},
),
),

In the body, we will create a container, and inside add a ListView.builder(). In ListView.builder, add an itemCount means the length of our list and add itemBuilder. In itemBuilder, we will return SimpleFoldingCell(), and inside add frontWidgetinnerTopWidget,and innerBottomWidget of the folding cell. We will add the _buildFrontWidget(index) method in the frontWidget, _buildInnerWidget(index) method in the innerTopWidget and _buildInnerBottomWidget() method in the innerBottomWidget, deeply define the below code. Also we add cellSize, animationDuration for folding cell.

First, we will define a frontWidget and for those we will create a _buildFrontWidget(index) method.

Widget _buildFrontWidget(int index) {
return Builder(
builder: (BuildContext context) {
return Container(
color: Colors.cyan[100],
alignment: Alignment.bottomCenter,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Aeologic Technology",
style: GoogleFonts.aldrich(
color: Color(0xFF2e282a),
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10,),
FlatButton(
onPressed: () {
final foldingCellState = context
.findAncestorStateOfType<SimpleFoldingCellState> ();
foldingCellState?.toggleFold();
},
child: Text(
"OPEN",
),
textColor: Colors.white,
color: Colors.indigoAccent[100],
splashColor: Colors.white.withOpacity(0.5),
),
],
),
);
},
);
}

In this widget, we will create a container and inside add a column widget. In the column widget, we will create a text and a FlatButton. In FlatButton, we will add a text and onPressed method add an open function. When the user pressed the cell, then the folding cell will be open. Container alignment was bottomCenter and also add color. When we run the application, we ought to get the screen’s output like the underneath screen capture.

frontWidget Folding Cell

Now, we will define an innerTopWidget and for those we will create a _buildInnerWidget(index) method.

Widget _buildInnerWidget(int index) {
return Builder(
builder: (context) {
return Container(
color: Colors.pink[100],
padding: EdgeInsets.only(top: 10),
child: Align(
alignment: Alignment.center,
child: Text(
_technologyList[index].title,
style: GoogleFonts.aldrich(
color: Colors.black,
fontSize: 20.0,
),
),
),
);
},
);
}

In this widget, we will return a container, add color for the user interaction, add a text, and wrap it to the align. The alignment was center. When the user opens the folding cell, the inner cell will be shown the top and center positions.

ow, we will define an innerBottomWidget and for those we will create a _buildInnerBottomWidget(), method.

Widget _buildInnerBottomWidget() {
return Builder(
builder: (context) {
return Container(
color: Colors.blueGrey[50],
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(bottom: 10),
child: FlatButton(
onPressed: () {
final foldingCellState = context
.findAncestorStateOfType<SimpleFoldingCellState>();
foldingCellState?.toggleFold();
},
child: Text(
"Close",
),
textColor: Colors.white,
color: Colors.redAccent[100],
splashColor: Colors.white.withOpacity(0.5),
),
),
);
}
);
}

We will return a container in this widget, and inside add color, alignment was bottomCenter, and FlatButton. In this Flatbutton, we will add text and onPressed method add a close function. When the user taps the close button, the folding cell will be closed and back to the frontWidget. When we run the application, we ought to get the screen’s output like the underneath screen capture.

inner Top & Bottom Widget Folding Cell

Code File:

https://gist.github.com/ShaiqAhmedkhan/f5c1aea3e17a5402d7525fd9eb84efa1#file-demo_screen-dart

Conclusion:

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

I hope this blog will provide you with sufficient information on Trying up the Folding Cell in your flutter projectsWe will show you what the Folding Cell is?. Make a demo program for working Folding Cell and show the front, inner top, and inner bottom widget open and also shows folding cells are in listview and animations when we open a new folder and closed the opened folder 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.

find the source code of the Flutter Folding Cell Demo:

flutter-devs/flutter_folding_cell_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


CompositedTransformFollower In Flutter

0

In Flutter, By adding them to the overlay’s stack, you can print visual parts on top of different widgets. A widget is added to the overlay utilizing an OverlayEntry, and the passage’s situation inside the overlay is chosen to utilize Positioned and AnimatedPositioned.

Like the Stack widget, this is useful when you require a thing to show on top of another widget. Nonetheless, you might utilize this widget anyplace without changing your whole codebase. You can do this utilizing the CompositedTransformTarget, CompositedTransformWidget, LayerLink, Overlay, and OverlayEntry widgets.

This blog will explore the CompositedTransformFollower In Flutter. We will see how to implement a demo program. We are going to learn about how to use a CompositedTransformFollower widget in your flutter applications.

CompositedTransformFollower class – widgets library – Dart API
A widget that follows a CompositedTransformTarget. When this widget is composited during the compositing phase (which…api. flutter.dev

Table Of Contents::

Introduction

Constructor

Properties

Code Implement

Code File

Conclusion



Introduction:

A widget that follows a CompositedTransformTarget.When this widget is composited during the compositing stage, it applies a change that brings the targetAnchor of the connected CompositedTransformTarget and followerAnchor of this widget together.

The two anchor focuses will have similar worldwide directions except if the balanced isn’t Offset. zero, in which case followerAnchor will be counterbalanced by offset in the connected CompositedTransformTarget’s direction space.

The LayerLink object utilized as the connection should be the very object that gave to the matching CompositedTransformTarget. The CompositedTransformTarget should come before the paint request than this CompositedTransformFollower.

Demo Module ::

This demo video shows how to use the CompositedTransformFollower in a flutter and shows how a CompositedTransformFollower class will work in your flutter applications. We will show a cyan container isn’t on the overlay however the green container is. The cyan container is an offspring of CompositedTransformTarget and the green container is the offspring of CompostedTransformFollower. They are connected utilizing a similar LayerLink instance.

Constructor:

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

const CompositedTransformFollower({
Key? key,
required this.link,
this.showWhenUnlinked = true,
this.offset = Offset.zero,
this.targetAnchor = Alignment.topLeft,
this.followerAnchor = Alignment.topLeft,
Widget? child,
})

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

Properties:

There are some parameters of CompositedTransformFollower are:

  • > link: This property is utilized to the connection object that interfaces this CompositedTransform Follower with a Composited Transform Target. This property must not be null.
  • > showWhenUnlinked: This property is used to showWhenUnlinked is valid, the child/ is apparent and not migrated when the widget isn’t connected; assuming it is false, the child is hidden.
  • > Offset: This property is utilized to the additional offset should be added to the related CompositedTransformTarget’s objective anchor to decide the place of this widget’s followed anchor.
  • > targetAnchor: This property is utilized to the location where followerAnchor will align itself on the connected CompositedTransformTarget as an anchor.
  • > followerAnchor: This property is utilized to the widget’s anchor point will line up with the associated CompositedTransformTarget’s followerAnchor.
  • > child: This property is utilized 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.

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.

In the main. dart file, we will create a new class Demo(). In this class, we will add four double variables are indicatorWidth was equal to 24, indicatorHeight was equal to 300, slideHeight was equal to 200, and slideWidth was equal to 400.

final double indicatorWidth = 24.0;
final double indicatorHeight = 300.0;
final double slideHeight = 200.0;
final double slideWidth = 400.0;

Then, we will add the LayerLink variable was layerLink is equal to the LayerLink(). Then we will add OverlayEntry and indicatorOffset is equal to the const Offset(0, 0).

final LayerLink layerLink = LayerLink();
OverlayEntry? overlayEntry;
Offset indicatorOffset = const Offset(0, 0);

We will add the getIndicatorOffset() method. In this method, we will add double x, double y, and return Offset(x, y).

Offset getIndicatorOffset(Offset dragOffset) {
final double x = (dragOffset.dx - (indicatorWidth / 2.0))
.clamp(0.0, slideWidth - indicatorWidth);
final double y = (slideHeight - indicatorHeight) / 2.0;
return Offset(x, y);
}

We will create the showIndicator() method. In this method, we will add the indicatorOffset is equal to the getIndicatorOffset, and overlayEntry is equal to the OverlayEntry() method. In this method, we will return Positioned widget. In this widget, we will add CompositedTransformFollower() widget.

void showIndicator(DragStartDetails details) {
indicatorOffset = getIndicatorOffset(details.localPosition);
overlayEntry = OverlayEntry(
builder: (BuildContext context) {
return Positioned(
top: 0.0,
left: 0.0,
child: SizedBox(
width: indicatorWidth,
height: indicatorHeight,
child: CompositedTransformFollower(
offset: indicatorOffset,
link: layerLink,
child: Container(
color: Colors.teal[400],
),
)),
);
},
);
Overlay.of(context)?.insert(overlayEntry!);
}

Now, we will create a updateIndicator() and hideIndicator() method. In updateIndicator, we will add indicatorOffset is equal to the getIndicatorOffset and overlayEntry?.markNeedsBuild(). In hideIndicator, we will add overlayEntry?.remove().

void updateIndicator(DragUpdateDetails details) {
indicatorOffset = getIndicatorOffset(details.localPosition);
overlayEntry?.markNeedsBuild();
}

void hideIndicator(DragEndDetails details) {
overlayEntry?.remove();
}

In the body, we will add CompositedTransformTarget() widget. In this widget, we will add a link equal to the layerLink variable, and its child we will add the Container widget with width, height, and color. Its child we will add GestureDetector() widget. In this widget, we will add onPanStart is equal to the showIndicator method, onPanUpdate is equal to the updateIndicator method, and onPanEnd is equal to the hideIndicator.

CompositedTransformTarget(
link: layerLink,
child: Container(
width: slideWidth,
height: slideHeight,
color: Colors.cyan[100],
child: GestureDetector(
onPanStart: showIndicator,
onPanUpdate: updateIndicator,
onPanEnd: hideIndicator,
),
),
),

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

Final Output

Code File:

import 'package:flutter/material.dart';
import 'package:flutter_composite_transform_follower_demo/splash_screen.dart';

void main() {
runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: Splash()));
}

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

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

class DemoState extends State {
final double indicatorWidth = 24.0;
final double indicatorHeight = 300.0;
final double slideHeight = 200.0;
final double slideWidth = 400.0;

final LayerLink layerLink = LayerLink();
OverlayEntry? overlayEntry;
Offset indicatorOffset = const Offset(0, 0);

Offset getIndicatorOffset(Offset dragOffset) {
final double x = (dragOffset.dx - (indicatorWidth / 2.0))
.clamp(0.0, slideWidth - indicatorWidth);
final double y = (slideHeight - indicatorHeight) / 2.0;
return Offset(x, y);
}

void showIndicator(DragStartDetails details) {
indicatorOffset = getIndicatorOffset(details.localPosition);
overlayEntry = OverlayEntry(
builder: (BuildContext context) {
return Positioned(
top: 0.0,
left: 0.0,
child: SizedBox(
width: indicatorWidth,
height: indicatorHeight,
child: CompositedTransformFollower(
offset: indicatorOffset,
link: layerLink,
child: Container(
color: Colors.teal[400],
),
)),
);
},
);
Overlay.of(context)?.insert(overlayEntry!);
}

void updateIndicator(DragUpdateDetails details) {
indicatorOffset = getIndicatorOffset(details.localPosition);
overlayEntry?.markNeedsBuild();
}

void hideIndicator(DragEndDetails details) {
overlayEntry?.remove();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(
'Flutter CompositedTransformFollower Demo',
style: TextStyle(fontSize: 18),
),
automaticallyImplyLeading: false,
backgroundColor: Colors.teal[400],
),
body: Center(
child: CompositedTransformTarget(
link: layerLink,
child: Container(
width: slideWidth,
height: slideHeight,
color: Colors.cyan[100],
child: GestureDetector(
onPanStart: showIndicator,
onPanUpdate: updateIndicator,
onPanEnd: hideIndicator,
),
),
),
),
);
}
}

Conclusion:

In the article, I have explained the CompositedTransformFollower basic structure in a flutter; you can modify this code according to your choice. This was a small introduction to CompositedTransformFollower 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 CompositedTransformFollower in your flutter projectsWe will show you what the Introduction is. Make a demo program for working with CompositedTransformFollower in your Flutter applications. So please try it.

❤ ❤ Thanks for reading this article ❤❤

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

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

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

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

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

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

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


Scratch Card In Flutter

0

Consistently we get our cell phones and send money to our friends to acquire some cash back. Cashback is a keen move to keep the user occupied with the application and keep up user maintenance.

For a typical user, it’s simply a lottery. In any case, would you say you are an application developer who is stunned by the UI and needs to implement the equivalent in your application? At that point, you are in the perfect spot.

In this blog, we will explore the Scratch Card In Flutter. We are going to see how to implement Scratch Card using the scratcher package in your flutter applications.

scratcher | Flutter Package
Scratch card widget, which temporarily hides content from the user. Android and iOS support Cover content with full color or…pub.dev

Table Of Contents::

Scratch Card

Properties

Implementation

Code Implement

Code File

Conclusion


Scratch Card :

Scratch Card is one of the famous things you can see on different shopping applications and payment applications. These Scratch Cards are utilized to offer prizes and cashback to users. It can have a wide scope of utilization cases; however, it is basically used to create random prizes for the application users.

Demo Module :

This demo video shows how to create a scratch card in a flutter. It shows how the scratch card will work using the scratcher package in your flutter applications. It shows a dialog open and then a scratch card, and you will earn money. It will be shown on your device.

Properties:

There are some properties of scratcher are:

  • > child: This property is used to declare the container and different Widgets.
  • > brushSize: This property is used to give the different sizes of the brush during the scratch.
  • > threshold: This property is used to give the percentage level of the scratch area.
  • > onChange: This property is used to call back is called when a new part of the area is revealed.
  • > color: This property is used to set the color of the scratcher card.
  • > Image: This property is used to declare an image on the scratch card.
  • > onThreshold: This property is used to evoke the callback.
  • > accuracy: This property is used to determines how accurate the report should progress. Lower accuracy means higher performance.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

scratcher: 

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/

Step 3: Import

import 'package:scratcher/scratcher.dart';

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

Step 5: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

Landing Page

In this screen, we will make a Container and set alignment to the center. Inside child property adds a FlatButton. In FlatButton, we will add text, color, shape, padding, and onPressed() method. We will add a scratchDialog(context) function.

Container(
alignment: Alignment.center,
child: FlatButton(
onPressed: (){
scratchDialog(context);
},
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
shape: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: BorderSide.none,
),
color: Colors.cyan[300],
child: Text("Scratch Card",
style: TextStyle(color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 20),),

),
),

Now, we will deeply define scratchDialog() function:

Scratch Dialog

We will create a dialog with a rectangle shape. In the title, we will add a column widget and alignment in the center. Inside the column, we will add text and a divider.

Future<void> scratchDialog(BuildContext context) {
return showDialog(context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
title: Column(
children: [
Align(
alignment: Alignment.center,
child: Text("You Earned Gift",
style: TextStyle(
color: Colors.red,
fontSize: 25,
fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(left: 25,right: 25),
child: Divider(
color: Colors.black,
),
),
],In
),

content: StatefulBuilder(builder: (context, StateSetter setState) {
return Scratcher(
color: Colors.cyan,
accuracy: ScratchAccuracy.low,
threshold: 30,
brushSize: 40,
onThreshold: () {
setState(() {
_opacity = 1;
});
},
child: AnimatedOpacity(
duration: Duration(milliseconds: 100),
opacity: _opacity,
child: Container(
height: MediaQuery.of(context).size.height*0.2,
width: MediaQuery.of(context).size.width*0.6,
child: Column(
children: [
Text("Hurray! you won",
style:TextStyle(fontSize: 20),),
Expanded(child: Image.asset("assets/gift.png",))
],
),
),
),
);
}),
);
}
);
}

In the content method, we will return Scratcher(). Inside scratcher, we will add a color of scratcher card, add an accuracy of scratch for better performance, add a threshold for the scratch area’s percentage level, and add a brushSize for the brush’s different sizes during the scratch. Inside child property, add an AnimatedOpacity(), we will add a duration, opacity, and child property to add conatiner with height and width. Inside the container, we will add text, image, and wrap to the column widget. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Final Output

Code File:

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

class ScratchCard extends StatefulWidget {
@override
_ScratchCardState createState() => _ScratchCardState();
}

class _ScratchCardState extends State<ScratchCard> {
double _opacity = 0.0;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Scratch Card In Flutter",
style: TextStyle(color: Colors.white),),
automaticallyImplyLeading: false,
),
body: Container(
alignment: Alignment.center,
child: FlatButton(
onPressed: (){
scratchDialog(context);
},
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
shape: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: BorderSide.none,
),
color: Colors.cyan[300],
child: Text("Scratch Card",
style: TextStyle(color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 20),),

),
),
);
}

Future<void> scratchDialog(BuildContext context) {
return showDialog(context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
title: Column(
children: [
Align(
alignment: Alignment.center,
child: Text("You Earned Gift",
style: TextStyle(
color: Colors.red,
fontSize: 25,
fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(left: 25,right: 25),
child: Divider(
color: Colors.black,
),
),
],
),

content: StatefulBuilder(builder: (context, StateSetter setState) {
return Scratcher(
color: Colors.cyan,
accuracy: ScratchAccuracy.low,
threshold: 30,
brushSize: 40,
onThreshold: () {
setState(() {
_opacity = 1;
});
},
child: AnimatedOpacity(
duration: Duration(milliseconds: 100),
opacity: _opacity,
child: Container(
height: MediaQuery.of(context).size.height*0.2,
width: MediaQuery.of(context).size.width*0.6,
child: Column(
children: [
Text("Hurray! you won",style: TextStyle(fontSize: 20),),
Expanded(child: Image.asset("assets/gift.png",))
],
),
),
),

);
}),
);
}
);
}
}

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Scratch Card in your flutter projectsWe will show you what the Scratch Card is?. Some scratcher properties, make a demo program for working Scratch Card and show a beautiful dialog open and scratch your card, and you will earn money/price using the scratcher 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.

find the source code of the Flutter Scratch Card Demo:

flutter-devs/flutter_scratch_card_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Giffy Dialog In Flutter

Animations give a superior encounter to the user. I know, and you may be realizing that Flutter has incredible help for Animations effortlessly of utilization. However, stand by, not in the situation of Dialogs. Flutter’s Dialogs have some basic and predefined Animations.

A dialog box advises the user about the circumstance that requires affirmation. Alert Box is a brief that takes user affirmation. The alert box’s fundamental utilization is utilized when we close the application, and typically, we are informed with a brief if we need to exit. That is a Dialog box.

In this blog, we will explore the Giffy Dialog In Flutter. We will also implement a demo program and create a beautiful fancy giffy dialog using the giffy_dialog package in your flutter applications.

giffy_dialog | Flutter Package
A beautiful and custom alert dialog for flutter highly inspired by FancyAlertDialog-Android. The source code is 100%…pub. dev

Table Of Contents ::

Giffy Dialog

Key Properties

Implementation

Code Implement

Code File

Conclusion



Giffy Dialog:

Giffy Dialogs is an exceptionally adaptable alert dialog box. It is actualized using the giffy_dialog package from a flutter. This package is totally written in Dart language and gives a wide scope of features. There are three kinds of Giffy dialogs are:

  • Asset Giffy Dialog
  • Network Giffy Dialog
  • Asset Giffy Dialog

Demo Module :

This demo video shows how to create a fancy giffy dialog in a flutter. It shows how giffy dialog will work using the giffy_dialog package in your flutter applications. It shows all three types of giffy dialog with different animations and creates a beautiful fancy giffy dialog. They will be shown on your device.

Key Properties :

There are some key properties of giffy dialog are :

  • > title: In this property, a dialog box title is set here. It is the primary text in the dialog.
  • > description: In this property was sets the secondary text of the dialog.
  • > entryAnimation: This property was used to set the direction from which the dialog will pop up.
  • > onOkButtonPressed: This property sets the action after the OK button in the dialog is pressed.
  • > buttonOkColor: In this property was set the button color you want.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

giffy_dialog: 

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/

Step 3: Import

import 'package:giffy_dialog/giffy_dialog.dart';

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

Step 5: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

Home Page

In this screen, we will make a Center in that center widget and then create a Column widget since we need to show Raised Button in a vertical structure. We will make a basic three Raised Buttons.

RaisedButton(
color: Colors.purple[300],
padding: EdgeInsets.only(left: 25,right: 25),
child: Text(
'Asset Giffy',
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {}
),
RaisedButton(
color: Colors.purple[300],
child: Text(
"Network Giffy",
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {}
),
RaisedButton(
color: Colors.purple[300],
padding: EdgeInsets.only(left: 28,right: 28),
child: Text(
'Flare Giffy',
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {}
),

Now we will deeply define all types of giffy dialog code below:

Asset Giffy Dialog:

In this Gif Dialog, we are making Asset Giffy Dialog, which will help you show giffy from the assets file, even if I add Title Text and Description Text. Animation property will be entryAnimation: ‘EntryAnimation.TOP_LEFT’. If you need to Customize Animation, at that point, you can change with the assistance ‘entryAnimation:.’

RaisedButton(
color: Colors.purple[300],
padding: EdgeInsets.only(left: 25,right: 25),
child: Text(
'Asset Giffy',
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {
showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
image: Image.asset(
'assets/education.gif',
fit: BoxFit.cover,
),
title: Text(
'Digital Working',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
),
entryAnimation: EntryAnimation.TOP_LEFT,
description: Text(
'Digital working is about understanding the role of technology.'
'This library helps you easily create fancy giffy dialog.',
textAlign: TextAlign.center,
style: TextStyle(),
),
buttonCancelColor:Colors.purple[300],
buttonOkColor:Colors.purple[300],
onOkButtonPressed: () {
Navigator.pop(context);
},
));
}),

These are the kind of giffy dialog that gets its content (like pictures) from the codebase itself. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Asset Giffy Dialog

Network Giffy Dialog:

In this Gif Dialog, we make Network Giffy Dialog, which will help you show giffy from Network or Url, even if I add Title Text and Description Text. Animation property will be entryAnimation: ‘EntryAnimation.BOTTOM_RIGHT’.

RaisedButton(
color: Colors.purple[300],
child: Text(
"Network Giffy",
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {
showDialog(
context: context,
builder: (_) => NetworkGiffyDialog(
image: Image.network(
"https://i.pinimg.com/originals/3d/36/c3/3d36c36a6bd147d3b65e4de86087f9f1.gif",
fit: BoxFit.cover,
),
entryAnimation: EntryAnimation.BOTTOM_RIGHT,
title: Text(
'Team Work',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
),
description: Text(
'Teamwork is the collaborative effort of a group to achieve a common goal or '
'to complete a task in the most effective and efficient way. '
'This library helps you easily create fancy giffy dialog.',
textAlign: TextAlign.center,
),
buttonCancelColor:Colors.purple[300],
buttonOkColor:Colors.purple[300],
onOkButtonPressed: () {
Navigator.pop(context);
},
));
}),

These are the kind of giffy dialog that gets its content (like pictures) from the internet. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Network Giffy Dialog

Flare Giffy Dialog:

In this Gif Dialog, we will utilize flare asset to show Flare Giffy Dialog. Like Network Giffy Dialog, even if I add Title Text and Description text in the Flare Giffy Dialog; however, you need to replace “image. network” with ‘flarepath’ and ‘flareAnimation’ which is shown in code. Animation property will be entryAnimation: ‘EntryAnimation.Default’.

RaisedButton(
color: Colors.purple[300],
padding: EdgeInsets.only(left: 28,right: 28),
child: Text(
'Flare Giffy',
style: TextStyle(
color: Colors.white,
),
),
onPressed: () {
showDialog(
context: context,
builder: (_) => FlareGiffyDialog(
flarePath: 'assets/space.flr',
flareAnimation: 'pull',
title: Text(
'Space',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
),
entryAnimation: EntryAnimation.DEFAULT,
description: Text(
'Space is the boundless three-dimensional extent in which objects and events have relative position and direction. '
'This library helps you easily create fancy flare dialog.',
textAlign: TextAlign.center,
style: TextStyle(),
),
buttonCancelColor:Colors.purple[300],
buttonOkColor:Colors.purple[300],
onOkButtonPressed: () {
Navigator.pop(context);
},
));
}),

These are the kind of giffy dialog that gets its content (like pictures) from the flare. A flarepath is allowed to it, and it acts likewise to that of Network giffy dialog in the rest of its working. When we run the application, we ought to get the screen’s output like the underneath screen capture.

Flare Giffy Dialog

Code File:

https://gist.github.com/ShaiqAhmedkhan/fe03e4e52e78db91fc81c3bcd8f9b06e#file-giffy_demo-dart

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Giffy Dialog in your flutter projectsWe will show you what the Giffy Dialog is?. Some key properties, make a demo program for working Giffy Dialog and create a beautiful fancy giffy dialog 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.

find the source code of the Flutter Giffy Dialog Demo:

flutter-devs/flutter_giffy_dialog_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Tutorial Coach Mark In Flutter

A Mobile Developer is otherwise called a mobile application developer or an application developer — is somebody who plans, develops, and executes mobile applications. They are answerable for the advancement of these software applications following suitable mobile platforms.

In this article, we will explore the Tutorial Coach Mark In Flutter. We will also implement a demo program and create a beautiful and easy tutorial using the tutorial_coach_mark package in your flutter applications.

tutorial_coach_mark | Flutter Package
Create a beautiful and easy tutorial for your application. Example 1 Example 2 To use this plugin, add…pub.dev

Table Of Contents::

Tutorial Coach Mark

Implementation

Code Implement

Code File

Conclusion



Tutorial Coach Mark:

Tutorial Coach Mark encourages you to introduce your application and its highlights in a beautiful, simple, and adaptable way.

Demo Module ::

This demo video shows how to use the tutorial coach mark in a flutter. It shows how tutorial coach mark will work using the tutorial_coach_mark package in your flutter applications and shows that when you tap the item, then the layout and shape were changing, skip button for stop tutorial, etc. They will be shown on your device.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

tutorial_coach_mark: 

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/

Step 3: Import

import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';

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

Step 5: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

First, we will create variables TutorialCoachMark and global keys.

TutorialCoachMark tutorialCoachMark;
List<TargetFocus> targets = List();

GlobalKey key = GlobalKey();
GlobalKey _key1 = GlobalKey();
GlobalKey _key2 = GlobalKey();
GlobalKey _key3 = GlobalKey();

In the body part, we will make one container inside, add an image, and wrap it with Alignment.topCenter and add a key. We will also create two raised buttons and add a different key and surround it with Align().

Container(
color: Colors.white,
child: Stack(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 170.0),
child: Align(
alignment: Alignment.topCenter,
child: Container(
key: key,
color: Colors.orange[100],
height: 100,
width: MediaQuery.of(context).size.width - 50,
child: Align(
alignment: Alignment.center,
child: Image.asset(
"assets/powered_by.png",
),
),
),
),
),
Align(
alignment: Alignment.center,
child: SizedBox(
width: 50,
height: 50,
child: RaisedButton(
key: _key2,
onPressed: () {},
),
),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(50.0),
child: SizedBox(
width: 50,
height: 50,
child: RaisedButton(
key: _key3,
onPressed: () {},
),
),
),
),

],
),
),

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

Before Tutorial Coach Mark

Now, we will create the initState() method. In this method, we will add an initTargets() method.

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

Now we will deeply define the initTargets() method.

In the initTargets() method, we will target all the list:

targets.add(
TargetFocus(
identify: "Target 0",
keyTarget: _key1,
contents: [
TargetContent(
align: ContentAlign.bottom,
child: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"Titulo lorem ipsum",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 20.0),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pulvinar tortor eget maximus iaculis.",
style: TextStyle(color: Colors.black),
),
)
],
),
))
],
),
);

In this target, we will add TargetFocus(). In this TargetFocus, we will add keyTarget, and identify the tutorial target and contents you want to show on your screen. When we run the application, we ought to get the screen’s output like the underneath screen capture.

AppBar Tutorial

In this target, we will add TargetFocus(). In this TargetFocus, we will add shape: ShapeLightFocus.RRect, radiusidentify the tutorial target, keyTargetcolor, and contents you want to be shown on your screen.

targets.add(
TargetFocus(
identify: "Target 1",
keyTarget: key,
color: Colors.red,
contents: [
TargetContent(
align: ContentAlign.bottom,
child: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Titulo lorem ipsum",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, fontSize: 20.0),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pulvinar tortor eget maximus iaculis.",
style: TextStyle(color: Colors.white),
),
)
],
),
),
)
],
shape: ShapeLightFocus.RRect,
radius: 5,
),
);

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

RRect Shape Tutorial

In this target, we will add TargetFocus(). In this TargetFocus, we will add shape: ShapeLightFocus.Circle, identify the tutorial target, keyTarget, and add multiple contents you want to be shown on your screen.

targets.add(TargetFocus(
identify: "Target 2",
keyTarget: _key2,
contents: [
TargetContent(
align: ContentAlign.top,
child: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Text(
"Multiples contents",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 20.0),
),
),
Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pulvinar tortor eget maximus iaculis.",
style: TextStyle(color: Colors.white),
),
],
),
)),
TargetContent(
align: ContentAlign.bottom,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Text(
"Multiples contents",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 20.0),
),
),
Container(
child: Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pulvinar tortor eget maximus iaculis.",
style: TextStyle(color: Colors.white),
),
),
],
))
],
shape: ShapeLightFocus.Circle,
));

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

Circle Shape With Multiples Contents Tutorial

In this target, we will add TargetFocus(). In this TargetFocus, we will add shape: ShapeLightFocus.Circle, identify the tutorial target, keyTargetcolor, and add contents inside the network image you want to be shown on your screen.

targets.add(TargetFocus(
identify: "Target 3",
keyTarget: _key3,
color: Colors.red,
contents: [
TargetContent(
align: ContentAlign.top,
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(10.0),
child: Image.network(
"https://flutterdevs.com/wp-content/uploads/2020/10/logog.png",fit: BoxFit.contain,
height: 120,
),
),
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Text(
"Image Load network",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 20.0),
),
),
Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pulvinar tortor eget maximus iaculis.",
style: TextStyle(color: Colors.white),
),
],
),
))
],
shape: ShapeLightFocus.Circle,
));

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

Circle Shape With Network Image Tutorial

Now, set a duration

void initState() {
initTargets();
WidgetsBinding.instance.addPostFrameCallback(_layout);
super.initState();
}

We we addPostFrameCallback(_layout). We will below define _layout() method:

void _layout(_){
Future.delayed(Duration(milliseconds: 100));
showTutorial();
}

This method will add Future dot delayed duration in 100 milliseconds and add a showTutorial() function.

Now, we will define showTutorial() function:

void showTutorial() {
tutorialCoachMark = TutorialCoachMark(
context,
targets: targets,
colorShadow: Colors.pink,
textSkip: "SKIP",
paddingFocus: 10,
opacityShadow: 0.8,
onFinish: () {
print("finish");
},
onClickTarget: (target) {
print('onClickTarget: $target');
},
onSkip: () {
print("skip");
},
onClickOverlay: (target) {
print('onClickOverlay: $target');
},
)..show();
}

In this function, we will use the variable TutorialCoachMark(). In this TutorialCoachMark(), we will add inside a context, targets, colorShadow, opacityShadow, paddingFocus, and the last you want to add ..show() method for showing the TutorialCoachMark.

Code File:

https://gist.github.com/ShaiqAhmedkhan/24e389b7b9fe797496eb3ac1f117d332#file-my_home_screen-dart

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Tutorial Coach Mark in your flutter projects. We will show you what the Tutorial Coach Mark? and indicate when you tap the item. The layout and shape were changing, skip button for stop tutorial, etc., and make a demo program for working Tutorial Coach Mark 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.

find the source code of the Flutter Tutorial Coach Mark Demo:

flutter-devs/flutter_tutorial_coach_mark_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Video Player In Flutter

Videos are everywhere — they can pass on data more rapidly than some other arrangement. From YouTube and Instagram stories to application development courses, playing videos straightforwardly inside your application is getting increasingly required.

How could play videos in Flutter? There is a library straightforwardly from the Flutter group just called video_player.

video_player | Flutter Package
A Flutter plugin for iOS, Android, and Web for playing back video on a Widget surface. Note: This plugin is still under…pub.dev

This library, nonetheless, is totally no frills. While it can play videos, it’s dependent upon you to add video playback controls and style it. There is a superior alternative that comes packaged with the UI, as you’d expect both on Android and iOS is Chewie.

chewie | Flutter Package
A video player for Flutter with Cupertino and Material play controlspub.dev

In this article, we will explore the Video Player In Flutter. We will also implement a demo program and use the chewie to play videos using the chewie and video_player package in your flutter applications.

Table Of Contents::

Introduction

Implementation

Code Implement

Code File

Conclusion



Introduction:

Chewie and video_player can play videos from three sources — assetsfiles, and network. Its excellence is that you don’t have to compose a ton of code to change the information source. Switching from an asset for a network video involves only a couple of keystrokes.

Demo Module ::

This demo video shows how to play videos in a flutter and shows how video player will work using the chewie and video_player package in your flutter applications, and also show video will autoplay, video speed, video controls, mute and unmute video, etc. they will be shown on your device.

Implementation:

Step 1: Add the dependencies

Add dependencies to pubspec — yaml file.

dependencies:

chewie: 
video_player:

Step 2: Add the assets

Add assets to pubspec — yaml file.

assets:

assets:
- assets/

Step 3: Import

import 'package:chewie/chewie.dart';
import 'package:video_player/video_player.dart';

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

Step 5: Add the internet permission

Add this to your project root>/android/app/src/main/AndroidManifest.xml:

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

Step 6: Enable AndriodX

Add this to your gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

How to implement code in dart file :

You need to implement it in your code respectively:

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

Presently comes an opportunity to begin playing videos. For that, Chewie gives its own widget, which is, as I’ve just referenced, just a covering on top of the VideoPlayer, which comes straightforwardly from the Flutter group.

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Chewie(
controller: _chewieController,
),
);
}

We should provide a chewie controller. We need to play various videos showed in a ListView; it will be ideal for putting the entirety of the video-playing-related things into its own widget because video player resources should be delivered.

Now we will create a three constructor a VideoPlayerController, looping, and autoplay.

final VideoPlayerController videoPlayerController;
final bool looping;
final bool autoplay;


VideoItems({
@required this.videoPlayerController,
this.looping, this.autoplay,
Key key,
}) : super(key: key);

We will add “_chewieController” in initState(). In ChewieController, we will add videoPlayerController its means “the controller for the video you want to play,” aspect ratio means“ the size of the video you want,” autoInitialize means “initialize the Video on Startup. This will prep the video for playback”, autoPlay means “play the video as soon as it’s displayed,” looping means “whether or not the video should loop,” errorBuilder means “when the video playback runs into an error, you can build a custom error message.

@override
void initState() {
super.initState();
_chewieController = ChewieController(
videoPlayerController: widget.videoPlayerController,
aspectRatio:5/8,
autoInitialize: true,
autoPlay: widget.autoplay,
looping: widget.looping,
errorBuilder: (context, errorMessage) {
return Center(
child: Text(
errorMessage,
style: TextStyle(color: Colors.white),
),
);
},
);
}

We need to create a StatefulWidget to get hold of the dispose() method.

@override
void dispose() {
super.dispose();
_chewieController.dispose();
}

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

We will call VideoItems() in home_screen file. We will add a video file from assets and add looping, autoplay for video.

VideoItems(
videoPlayerController: VideoPlayerController.asset(
'assets/video_6.mp4',
),
looping: true,
autoplay: true,
),

We will add a video file from the network, and also, when the URL doesn’t exist will display an error.

VideoItems(
videoPlayerController: VideoPlayerController.network(
'https://assets.mixkit.co/videos/preview/mixkit-a-girl-blowing-a-bubble-gum-at-an-amusement-park-1226-large.mp4'
),
looping: false,
autoplay: true,
),

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

Final Output

Code File:

import 'package:flutter/material.dart';
import 'package:flutter_video_player_demo/video_items.dart';
import 'package:video_player/video_player.dart';


class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blueGrey[100],
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text('Flutter Video Player Demo'),
centerTitle: true,
),
body: ListView(
children: <Widget>[
VideoItems(
videoPlayerController: VideoPlayerController.asset(
'assets/video_6.mp4',
),
looping: true,
autoplay: true,
),
VideoItems(
videoPlayerController: VideoPlayerController.network(
'https://assets.mixkit.co/videos/preview/mixkit-a-girl-blowing-a-bubble-gum-at-an-amusement-park-1226-large.mp4'
),
looping: false,
autoplay: true,
),
VideoItems(
videoPlayerController: VideoPlayerController.asset(
'assets/video_3.mp4',
),
looping: false,
autoplay: false,
),
VideoItems(
videoPlayerController: VideoPlayerController.asset(
'assets/video_2.mp4',
),
autoplay: true,
),
VideoItems(
videoPlayerController: VideoPlayerController.network(
"https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4"
),
looping: true,
autoplay: false,
),
],
),
);
}
}

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Video Player in your flutter projects. We will show you that Chewie is a Flutter package pointed toward simplifying the way toward playing videos. Rather than managing a start, stop, and pause button, doing the overlay to show the video’s advancement, Chewie does these things for you and make a demo program for working video player 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.

find the source code of the Flutter Video Player Demo:

flutter-devs/flutter_video_player_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.


Explore Transform Widget In Flutter

0

Flutter made it simple for developers to build complex UI in record time. With various magnificent widgets like Rows, Columns, ListView, and Positioned, we can play around the screen, get our ideal output, and be fulfilled toward the day’s end. In any case, imagine a scenario where you need a widget that isn’t accessible in the Flutter Widget Catalog?.

In this article, We will Explore Transform Widget In Flutter. We will build a demo program that shows how to use a flutter Transform widget, and we will also show a Scale, Skew, Translate, and Rotate in your Flutter applications.

Table Of Contents::

Introduction

Types Of Transform Widget

Scale

Skew

Rotate

Translate

Code File

Conclusion



Introduction:

Transform is a widget that applies a transformation before painting its child, which implies the transformation isn’t considered while figuring how much space this present widget’s child (and accordingly this widget) burns-through.

For more info on Transform Widget,Watch this video:

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

We will make four buttons on this home page screen, and each button will show Transform in your flutter application.

Home Screen

All buttons were showing different transform. We will show the deeply below detail.

Types Of Transform Widget:

The Transform widget has a transform property with which we can tell the activity’s sort we need: Scale, Skew, Translate, Rotate, and depict how this transforming activity will be.

The types of Transform Widget are:

  • Transform.scale
  • Transform (default constructor)
  • Transform.rotate
  • Transform.translate

Scale:

It is a Transform. Scale constructor. The scale constructor scales the child by the given scale boundary. The scale argument should not be null. It gives the scalar by which to increases the x and y axes. The alignment controls the beginning of the scale; by default, this is the container’s bottom-center.

Before Transform Scale

We will make a container, and the alignment was top-left and his child’s property. We will make another container with height and width and add an image.

Container(
color: Colors.black38,
width: double.infinity,
height: MediaQuery.of(context).size.height*0.25,
alignment: Alignment.topLeft,
child: Container(
color: Colors.teal[50],
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png")),
),

We will then wrap a container from the Transform.scale and add Scale down (0.7) with the bottom-center corner. The container was shrink due to scale property.

Container(
color: Colors.black38,
width: double.infinity,
height: MediaQuery.of(context).size.height*0.25,
alignment: Alignment.topLeft,
child: Transform.scale(
alignment: Alignment.bottomCenter,
scale: 0.7,
child: Container(
color: Colors.teal[50],
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png")),
),
),

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

Transform Scale

Skew:

There is not a Transform. Skew constructor. It is a default constructor. So we will utilize the Transform widget with the transform property: Transform.skewX(double alpha) or Transform.skewY(double alpha).The alignment controls the cause of the skew; of course, this is the top-left corner.

Before Transform Skew

Before skewing the yellow container inside an image, we will put it inside another, a blue-grey background container, which will clearer the skewed yellow container. We will also use this blue-grey background container to define the margins to the right and left sides.

Container(
margin: EdgeInsets.only(left: 30,right: 30),
color: Colors.blueGrey,
width: double.infinity,
height: MediaQuery.of(context).size.height*0.25,
alignment: Alignment.topLeft,
child: Container(
width: MediaQuery.of(context).size.width*0.4,
color: Colors.yellow[100],
child: Image.asset("assets/powered_by.png"))
),
)

Now, we will wrap a yellow container from the Transform and add Skew along the X-axis. The container direction was to go the x-axis direction.

Container(
margin: EdgeInsets.only(left: 30,right: 30),
color: Colors.blueGrey,
width: double.infinity,
height: MediaQuery.of(context).size.height*0.25,
alignment: Alignment.topLeft,
child: Transform(
transform: Matrix4.skewX(0.4),
child: Container(
width: MediaQuery.of(context).size.width*0.4,
color: Colors.yellow[100],
child: Image.asset("assets/powered_by.png")),
)
),

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

Transform Skew X-axis

We add Skew along the Y-axis. The container direction was to go the y-axis direction.

Transform(
transform: Matrix4.skewY(0.4),
child: Container(
width: MediaQuery.of(context).size.width*0.4,
color: Colors.yellow[100],
child: Image.asset("assets/powered_by.png")),
)

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

Transform Skew Y-axis

We add Skew along the Y-axis with negative alpha. The container direction was to go the negative y-axis direction.

Transform(
transform: Matrix4.skewY(-0.4),
child: Container(
width: MediaQuery.of(context).size.width*0.4,
color: Colors.yellow[100],
child: Image.asset("assets/powered_by.png")),
)

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

Transform Skew Y-axis With Negative Alpha

Rotate:

It is a Transform. Rotate constructor. The rotate constructor rotates the child by the given angle parameter. The rotate argument must not be null.

Before Transform Rotate

Before transform rotates, We will make a container and add a cyan color, and his child’s property will add an image.

Container(
color: Colors.cyanAccent[100],
height: MediaQuery.of(context).size.height*0.25,
width: MediaQuery.of(context).size.width*0.7,
child: Image.asset("assets/powered_by.png"),
),

Now, we will wrap an image from Transform.rotateand we will add an angle is pi/2. Then the image is rotated 90-degree angle.

Container(
color: Colors.cyanAccent[100],
height: MediaQuery.of(context).size.height*0.25,
width: MediaQuery.of(context).size.width*0.7,
child: Transform.rotate(
angle: pi/2,
child: Image.asset("assets/powered_by.png")),
),

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

Transform Rotate

Translate:

It is a Transform. Translate constructor. We will utilize the constructor Transform.translate rather than the transform property of the Transform widget. It should not be null. It indicates the translation.

Before Transform Translate

Before transform translate, we will make a container and inside make a decoration box, border-radius, height, width, and his child property we will add an image.

Container(
decoration: BoxDecoration(
color: Colors.blueGrey[100],
borderRadius: BorderRadius.circular(20.0),
),
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png"),
),

Now, we will wrap a container from Transform.rotateand add an offset(dx,dy). We will translate the X-axis is 130 and Y-axis will be zero.

Transform.translate(
offset: Offset(130, 0),
child: Container(
decoration: BoxDecoration(
color: Colors.blueGrey[100],
borderRadius: BorderRadius.circular(20.0),
),
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png"),
),
),

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

Transform Translate X-axis

Now, we will add an offset(dx,dy). We will translate the Y-axis is 130 and X-axis will be zero.

Transform.translate(
offset: Offset(0, 130),
child: Container(
decoration: BoxDecoration(
color: Colors.blueGrey[100],
borderRadius: BorderRadius.circular(20.0),
),
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png"),
),
),

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

Transform Translate Y-axis

Now, we will add an offset(dx,dy). We will translate the both X-axis and Y-axis will be 130.

Transform.translate(
offset: Offset(130, 130),
child: Container(
decoration: BoxDecoration(
color: Colors.blueGrey[100],
borderRadius: BorderRadius.circular(20.0),
),
width: MediaQuery.of(context).size.width*0.4,
height: MediaQuery.of(context).size.height*0.12,
child: Image.asset("assets/powered_by.png"),
),
),

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

Transform Translate X-axis & Y-axis

Code File:

https://gist.github.com/ShaiqAhmedkhan/25b64bd87372e1f97b8bbaf0b7f65d8e#file-transform_home_screen-dart

Conclusion:

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

I hope this blog will provide you with sufficient information in Trying up the Explore Transform Widget in your flutter projects. We will show you what the transform widget is?, types using in Transform, and make a demo program for working Transform 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.

find the source code of the Flutter Transform Widget Demo:

flutter-devs/flutter_transform_widget_demo
A new Flutter application. This project is a starting point for a Flutter application. A few resources to get you…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 FacebookGitHubTwitter, 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.