Skip to content

xlcs0110/flutter-if-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

if_widget

An if statement widget.

you never need

bool _statement = true;

Container(
    child:_stament==true?GestureDetector(
        child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
    ):Container())
)

Getting Started

bool _statement = true;

Container(
    child:If(_statement,
    child:GestureDetector(
        child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
    ))
)

/// or

Container(
    child:If(_statement,
    builder:(context)=>GestureDetector(
        child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
    ))
)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages