Add the following dependency
simple_animations: ^2.2.1
Add the following package
import 'package:simple_animations/simple_animations.dart';
There are three types of animations comes under simple features
1.) Stateless Animations
PlayAnimation( // <-- specify type of animated variable tween: Colors.red.tweenTo(Colors.blue), // <-- define tween of colors builder: (context, child, value) { // <-- builder function return Container( color: value, // <-- use animated value width: 100, height: 100 ); });
2.) MultiTween
enum AniProps { width, height, color } // <-- define properties class MyWidget extends StatelessWidget { final _tween = MultiTween() // <-- design tween ..add(AniProps.width, 0.0.tweenTo(400.0), 1000.milliseconds) ..add(AniProps.width, 400.0.tweenTo(300.0), 1000.milliseconds) ..add(AniProps.height, 500.0.tweenTo(200.0), 2000.milliseconds) ..add(AniProps.color, Colors.red.tweenTo(Colors.blue), 2.seconds); @override Widget build(BuildContext context) { return ... // <-- use tween } }
3.) Anicoto
class _MyAnimatedWidgetState extends Statewith AnimationMixin { // <-- add AnimationMixin to state class Animation size; // <-- declare animation variable @override void initState() { size = 0.0.tweenTo(200.0).animatedBy(controller); // <-- connect tween and controller and apply to animation variable controller.play(); // <-- start the animation playback super.initState(); } @override Widget build(BuildContext context) { return Container( width: size.value, // <-- use animation variable's value here height: size.value, // <-- use animation variable's value here color: Colors.red ); } }
This is used for making ListView items to display with some animations. We can also perform these animations in GridView, Column and Row.
Add the following dependency inside the “pubspec.yaml”.
dependencies:
flutter_staggered_animations: "^0.1.2"
Add the following package to get all the features present in Staggered Animations.
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
Basic Use
Basic usage of Staggered Animations which we can use in the ListView.
@override Widget build(BuildContext context) { return Scaffold( body: AnimationLimiter( child: ListView.builder( itemCount: 100, itemBuilder: (BuildContext context, int index) { return AnimationConfiguration.staggeredList( position: index, duration: const Duration(milliseconds: 375), child: SlideAnimation( verticalOffset: 50.0, child: FadeInAnimation( child: YourListChild(), ), ), ); }, ), ), ); }
This package contains three types of classes for making staggered animations.
1.) Animation
2.) AnimationConfiguration
3.) AnimationLimiter
We can use different types of animations to make items of list to display accordingly.
It is a simple folding widget where we can hide our main content and show it when clicked on open. It is available on both iOS & Android and also on the Web.
Add the following dependency into your “pubspec.yaml” file in order to access all the features in it.
dependencies:
folding_cell: "^1.0.0"
Add the following package
import 'package:folding_cell/folding_cell.dart';
Basic Usage
We need to create all the cards to show the information to the user.
v 1.0.0
class FoldingCellSimpleDemo extends StatelessWidget { final _foldingCellKey = GlobalKey(); @override Widget build(BuildContext context) { return Container( color: Color(0xFF2e282a), alignment: Alignment.topCenter, child: SimpleFoldingCell.create( key: _foldingCellKey, frontWidget: _buildFrontWidget(), innerWidget: _buildInnerWidget(), cellSize: Size(MediaQuery.of(context).size.width, 140), padding: EdgeInsets.all(15), animationDuration: Duration(milliseconds: 300), borderRadius: 10, onOpen: () => print('cell opened'), onClose: () => print('cell closed'), ), ); } Widget _buildFrontWidget() { return Container( color: Color(0xFFffcd3c), alignment: Alignment.center, child: Stack( children: [ Align( alignment: Alignment.center, child: Text( "CARD TITLE", style: GoogleFonts.aldrich( color: Color(0xFF2e282a), fontSize: 20.0, fontWeight: FontWeight.bold, ), ), ), Positioned( right: 5, bottom: 0, child: FlatButton( onPressed: () => _foldingCellKey?.currentState?.toggleFold(), child: Text( "OPEN", ), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5), ), ) ], ), ); } Widget _buildInnerWidget() { return Container( color: Color(0xFFecf2f9), padding: EdgeInsets.only(top: 10), child: Stack( children: [ Align( alignment: Alignment.topCenter, child: Text( "CARD TITLE", style: GoogleFonts.aldrich( color: Color(0xFF2e282a), fontSize: 22.0, fontWeight: FontWeight.bold, ), ), ), Align( alignment: Alignment.center, child: Text( "CARD DETAIL", style: GoogleFonts.aldrich( color: Color(0xFF2e282a), fontSize: 40.0, ), ), ), Positioned( right: 5, bottom: 0, child: FlatButton( onPressed: () => _foldingCellKey?.currentState?.toggleFold(), child: Text( "Close", ), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5), ), ), ], ), ); } }
v 0.1.2
class FoldingCellSimpleDemo extends StatelessWidget { final _foldingCellKey = GlobalKey(); @override Widget build(BuildContext context) { return Container( color: Color(0xFF2e282a), alignment: Alignment.topCenter, child: SimpleFoldingCell( key: _foldingCellKey, frontWidget: _buildFrontWidget(), innerTopWidget: _buildInnerTopWidget(), innerBottomWidget: _buildInnerBottomWidget(), cellSize: Size(MediaQuery.of(context).size.width, 125), padding: EdgeInsets.all(15), animationDuration: Duration(milliseconds: 300), borderRadius: 10, onOpen: () => print('cell opened'), onClose: () => print('cell closed')), ); } Widget _buildFrontWidget() { return Container( color: Color(0xFFffcd3c), alignment: Alignment.center, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text("CARD", style: TextStyle( color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800)), FlatButton( onPressed: () => _foldingCellKey?.currentState?.toggleFold(), child: Text( "Open", ), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5), ) ], )); } Widget _buildInnerTopWidget() { return Container( color: Color(0xFFff9234), alignment: Alignment.center, child: Text("TITLE", style: TextStyle( color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800))); } Widget _buildInnerBottomWidget() { return Container( color: Color(0xFFecf2f9), alignment: Alignment.bottomCenter, child: Padding( padding: EdgeInsets.only(bottom: 10), child: FlatButton( onPressed: () => _foldingCellKey?.currentState?.toggleFold(), child: Text( "Close", ), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5), ), ), ); } }
Understand what drives customer satisfaction and loyalty through their genuine feedback and insights.
We've been working with Amar Infotech since 2014 on our project, Lyrics Guru. Their team provided top-notch Flutter Mobile App development along with a Laravel admin panel, perfectly meeting our needs.
Over the years, their consistent support and expertise have been invaluable to us.
We highly recommend Amar Infotech for their exceptional service and dedication to client success.
Hi, I'm Philipp Müller, CEO of a Tour and Travel Agency in Sri Lanka. We chose Amar Infotech to bring our website to life with their Tour Package Extranet Services.
hey delivered excellent service, developing a Laravel-based backend that allows us to create and customize our own tour packages easily.
I highly recommend Amar Infotech for their professionalism and expertise in web development.
Hello, my name is Tito. We would like to extend our gratitude to Amar Infotech for their invaluable assistance in developing our website and app.
They were extremely helpful throughout the entire journey, guiding us every step of the way. Their professionalism is second to none.
Thanks to them, we now have a fully functional Flight Booking website that perfectly meets our needs.
I am the owner of Sammy Tours Sri Lanka, and I am thrilled with Amar Infotech for designing and developing my travel and tourism website.
They created a custom website that perfectly showcases our tour packages for Sri Lanka. Their expertise and dedication have significantly impacted our business.
I highly recommend Amar Infotech for their exceptional service and commitment to excellence.
Select the ideal remote team tailored to your business needs.
Enjoy up to 30% savings with our competitive solutions.
Leverage the expertise of over 100 skilled IT professionals.
Ensure success with agile project management and consistent, reliable outcomes.
Benefit from cutting-edge technology and creative approaches that drive your business forward.
Discover how we drive success with innovative solutions tailored for your needs. Get a comprehensive overview of our expertise and achievements in just one click.
Download NowExpanding horizons with a global network of representatives dedicated to delivering excellence across borders.
4th Floor, Sunrise Avenue, Stadium - Commerce Six Road, Ahmedabad, INDIA
sales@amarinfotech.comAI Jones (Account Executive), Phoenix, AZ 85013, 1.623.205.2415
ajones@amarinfotech.comRonak Patel (Sales Person), 64 caranci crescent Brampton ON Canada
ronak@amarinfotech.comJessica (Sales Person), 9 nirimba drive quackers hill nsw 2763
jessica@amarinfotech.comAdam (Sales Person) in Breda, Netherlands
adam@amarinfotech.com