condition_helper 0.0.4
condition_helper: ^0.0.4 copied to clipboard
Make it easier for you to set the Case for specific method.
Condition Helper #
This plugin will make it easier for you to set the Case for specific method.
Usage #
This method will do nothing if the current platform is other than Android and iOS.
final condition = ConditionHelper('SurveyBanner');
Use this method to check the Case:
final state = await condition.check();
if (state == ConditionState.satisfied) {
// Do something
}
Or if you want to show a Widget
FutureBuilder(
future: ConditionHelper('SurveyBanner').check(),
build: (context, snapshot) {
if (snapshot.data != ConditionState.satisfied) {
return SizedBox.shrink();
}
return SurveyBanner();
}
);