availability 1.0.0
availability: ^1.0.0 copied to clipboard

control when to render the widget (similar to Visibility but with WidgetBuilder)

Availability #

A simple if-else widget renderer in an object-oriented way. You can find it similar to Visibility, but with WidgetBuilder usage. With this, the child widget is not put into context until the condition is satisfied.

#code-for-fun

Getting Started #

Usage: #

Availability(
    available: <condition>,
    childBuilder: (BuildContext context) => <widget>,
)

or

Availability(
    available: <condition>,
    childBuilder: (BuildContext context) => <widget>,
    elseBuilder: (BuildContext context) => <another_widget>,
)

*** Similar dart code without Availability:

if (<condition>) {
    return <widget>;
} else {
    return <another_widget>;
}
1
likes
110
pub points
13%
popularity

control when to render the widget (similar to Visibility but with WidgetBuilder)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on availability