Adds Navigator.maybeOf to replace calling Navigator.of(context, nullOk: true), and removes the nullOk parameter. Also changes Navigator.of to return a non-nullable value, and removes many (120!) instances of the ! operator, reducing the possible places where a null dereference could occur.
* Added notificationListner sample code
* Fixed spacing
* fixed spacing
* Moved the variables into the Build method
* fixed typos
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
* Update packages/flutter/lib/src/widgets/notification_listener.dart
Co-authored-by: John Ryan <ryjohn@google.com>
Change the semantics of Actions.invoke so that if the action it finds is disabled, then it keeps looking for an ancestor Actions widgets that has a matching intent where the action is not disabled.
This reverts usages of the binding's platformDispatcher to use window again temporarily, because there isn't a TestPlatformDispatcher yet, and so some tests were failing because they mocked the TestWindow to return certain things (locales) that were returning the real values instead of the test values.
Once I've created a TestPlatformDispatcher to allow fake data to be passed to it, we can go back to using the platformDispatcher in all of these places
* Remove references to dart:ui.Window, and point usages to PlatformDispatcher or SingletonFlutterWindow, as appropriate
* remove new test platform dispatchers
* Amend documentation
* Fix crash when widgetspan does not produce a semantics node in render paragraph
* fix comments
* fixed corner case, added test, refactored semantics widget
* addressing comment
This removes the nullOk parameter from Focus.of, FocusTraversalOrder.of and FocusTraversalGroup.of, and creates maybeOf equivalents for each. The of methods now return non-nullable values, and the maybeOf equivalents return nullable values.
This removes the nullOk parameter from AnimatedList.of and SliverAnimatedList.of, and creates maybeOf equivalents for each. The of methods now return non-nullable values, and the maybeOf equivalents return nullable values.
This removes the nullOk parameter from Router.of, and createsRouter.maybeOf. Router.ofnow returns a non-nullable value, and the Router.maybeOf returns a nullable value.
This removes the nullOk parameter from Shortcuts.of, Actions.find and Actions.handler and created Shortcuts.maybeOf and Actions.maybeFind. Shortcuts.of and Actions.find now return non-nullable values, and the maybe versions return a nullable value. I didn't create a non-nullable version of Actions.handler, since it needs to be able to return null if an action is not enabled, but I did remove the nullOk parameter, effectively setting it to true permanently, since setting it to false doesn't make much sense if the function can still return null when the action is not enabled.