ignoreErrorInTesting property
A flag testing the Error routine INSIDE the testing It's set and reset ONLY when testing. Allows a one-time even to ignore an error during testing.
Implementation
bool get ignoreErrorInTesting => _ignoreErrorInTesting ?? false;
Implementation
set ignoreErrorInTesting(bool? ignore) {
// Assigns a value only in testing.
if (ignore != null && WidgetsBinding.instance is! WidgetsFlutterBinding) {
if (_ignoreErrorInTesting == null) {
_ignoreErrorInTesting = ignore;
} else {
// Once set false, it can't be changed again
if (_ignoreErrorInTesting!) {
_ignoreErrorInTesting = ignore;
}
}
}
}