testNotifier<T> function
Runs a test on a StateNotifier and returns the list of emitted states.
Implementation
List<T> testNotifier<T>(
StateNotifier<T> notifier, void Function(StateNotifier<T>) action) {
final states = <T>[];
final remove = notifier.addListener((s) => states.add(s));
action(notifier);
remove();
return states;
}