waitForState<T> method
Wait for state to have a specific value
Implementation
Future<void> waitForState<T>(
String key,
T expectedValue, {
Duration timeout = const Duration(seconds: 5),
}) async {
await waitFor(() => getState<T>(key) == expectedValue, timeout: timeout);
}