waitCondition<St> static method
Future<ReduxAction<St> ?>
waitCondition<St>(
- BuildContext context,
- bool condition(
- St
- int? timeoutMillis,
Returns a future which will complete when the given state condition
is true.
If the condition is already true when the method is called, the future completes immediately.
You may also provide a timeoutMillis
, which by default is 10 minutes.
To disable the timeout, make it -1.
If you want, you can modify Store.defaultTimeoutMillis to change the default timeout.
var action = await store.waitCondition((state) => state.name == "Bill");
expect(action, isA<ChangeNameAction>());
Implementation
static Future<ReduxAction<St>?> waitCondition<St>(
BuildContext context,
bool Function(St) condition, {
int? timeoutMillis,
}) =>
backdoorInheritedWidget<St>(context).waitCondition(condition, timeoutMillis: timeoutMillis);