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();
    }
);

Libraries

condition_helper