flutter show widget with animation code example

Example 1: list widget flutter

ListView(
  padding: const EdgeInsets.all(8),
  children: <Widget>[
    Container(
      height: 50,
      color: Colors.amber[600],
      child: const Center(child: Text('Entry A')),
    ),
    Container(
      height: 50,
      color: Colors.amber[500],
      child: const Center(child: Text('Entry B')),
    ),
    Container(
      height: 50,
      color: Colors.amber[100],
      child: const Center(child: Text('Entry C')),
    ),
  ],
)

Example 2: transform widget in flutter

Transform.rotate(  angle: 1.0,  child: Container(    height: 200.0,    width: 200.0,    color: Colors.pink,  ),),

Example 3: stateless widget flutter

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

  
  Widget build(BuildContext context) {
    return Container(color: const Color(0xFF2DBD3A));
  }
}

Example 4: flutter show widget with animation

//Check this out  
https://www.smashingmagazine.com/2019/10/animation-apps-flutter/

Example 5: flutter inhereted widget

class MyInherited extends InheritedWidget {
  const MyInherited({
    Key key,
     Widget child,
  }) : super(key: key, child: child);


  static MyInherited of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<MyInherited>();
  }

  //if you have properties, it should look something like:
  // bool updateShouldNotify(MyInherited old) => old.prop !== new.prop;
  
  //if you don't: 
  
  bool updateShouldNotify(MyInherited old) => false;
  
}

Tags:

Dart Example