Making things visible and invisible in flutter

 body: Center(

  child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Visibility(
visible: isVisible,
maintainAnimation: true,
maintainSize: true,
maintainState: true,
child: Container(
height: 200,
width: 200,
color: Colors.red,
),
),
ElevatedButton(onPressed: (){
setState(() {
isVisible =! isVisible;
});
}, child: const Icon(Icons.slideshow))
],
),
)

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

Learning stage | c++ programs

c++ basic question