Placeholder Widget in Flutter

A widget that draws a box that represents where other widgets will one day be added. This widget is useful during development to indicate that the interface is not yet complete.

 

Properties

 

  • color
  • strokeWidth
  • fallbackWidth
  • fallbackHeight

 

Example 1:

 

Center(

          child: Container(

            height: 300,

            width: 300,

            child: Placeholder(),

          ),

        ),

 

Example 2:

 

const Placeholder(

          color: Colors.blue,

          strokeWidth: 15,

          fallbackHeight: 20,

          fallbackWidth: 150,

        ),

 

Example 3:

 

Container(

          child: Column(

            children: const [

              Flexible(child: Placeholder()),

              Flexible(child: Placeholder()),

            ],

          ),

        ),


Video Link:

 
Post a Comment (0)
Previous Post Next Post