Fix various strong mode issues. (#14284)
This commit is contained in:
committed by
GitHub
parent
122796137b
commit
340d9e00cf
@@ -463,7 +463,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
));
|
||||
assert(_parentZone != null);
|
||||
assert(_pendingExceptionDetails != null, 'A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle. Typically, this is caused by using expect() before restoring FlutterError.onError.');
|
||||
_parentZone.run<Null>(_testCompletionHandler);
|
||||
_parentZone.run<void>(_testCompletionHandler);
|
||||
}
|
||||
);
|
||||
_parentZone = Zone.current;
|
||||
|
||||
@@ -132,8 +132,12 @@ class WidgetController {
|
||||
Iterable<State> get allStates {
|
||||
TestAsyncUtils.guardSync();
|
||||
return allElements
|
||||
// TODO(vegorov) replace with Iterable.whereType, when it is available. https://github.com/dart-lang/sdk/issues/27827
|
||||
.where((Element element) => element is StatefulElement)
|
||||
.map((StatefulElement element) => element.state); // ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27827
|
||||
.map((Element element) {
|
||||
final StatefulElement statefulElement = element;
|
||||
return statefulElement.state;
|
||||
});
|
||||
}
|
||||
|
||||
/// The matching state in the widget tree.
|
||||
|
||||
Reference in New Issue
Block a user