Create simple UI

Firstly we will create a simple UI using Container and Text Widget in it and change its state (width and height) using setState on the click of Floating Action Button.
 

Your code should look like this : 

       Container(
            width: bigger ? 600 : 450,
            height: bigger ? 400 : 300,
            color: Colors.orange,
            child: Center(
              child: Text(
                "Implicit Animating Widgets",
                textAlign: TextAlign.center,
                style: TextStyle(
                    fontSize: 30,
                    color: Colors.black,
              ),
            ),
          ),

 

to change value/state in onPressed of FAB : 

         onPressed: () {
            setState(() {
              bigger = !bigger;
            });
          },

Simple Container and Text

 

Discussion

4

0