if_widget 0.0.3
if_widget: ^0.0.3 copied to clipboard

An if statement widget.

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'))
    ))
)

1
likes
90
pub points
0%
popularity

Publisher

Unknown

An if statement widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on if_widget