Show and hide Flutter controls

In Android, use the visibility property to control whether a View is displayed.
Similarly, Flutter also uses Visibility to control whether the widget is displayed.
It can also be controlled using Offstage or Opacity.

 Visibility ( 
   visible :  true , 
   //Whether to keep the placeholder 
   maintainState :  false , 
   child :  Text ( "Show" ) , 
 ) , 
 //The control can be hidden or shown, but it will not occupy the place when it is hidden. 
 Offstage ( 
   offstage :  true , 
   child :  Text ( "display" ) , 
 ) , 
 ///0 means completely transparent, also equivalent to hiding 
 ///1 means completely opaque, equivalent to fully displaying 
 Opacity ( 
   opacity :  0 , 
   child :  Text ("Hide" ) , 
 ) ,
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

Related: Show and hide Flutter controls