The FocusManager constructor was registering global event handlers
on the shared RawKeyboard instance and the global pointer router.
This posed a few problems: (1) there was no way to unregister these
handlers, and (2) instantiating a second FocusManager would overwrite
the existing focus manager's RawKeyboard handler. This was manifesting
in unexpected ways, such as the fact that constructing a second
BuildOwner (for a parallel tree, for instance) was obliterating the
event handler for the main BuildOwner's focus manager, thus messing
with focus.
This change separates those global event registrations into a
dedicated method, registerGlobalHandlers(), and overrides dispose()
to properly unregister those handlers.
This gets away from the extra static map for global key registrations
in favor of the data structures being instance properties of the build
owner. This still allows for semantically-equivalent static access through
the binding (which in turn gives access to the build owner).
This also adds a `BuildOwner.globalKeyCount` getter to get the count
of global keys associated with widgets currently in the tree.
Element.rebuild() and BuildOwner.buildScope() both had code to
manager the `BuildOwner._debugCurrentBuildTarget` state variable.
Unfortunately, only one of the two places was using a try/finally
to ensure that the state variable was restored even if an error
was thrown.
This creates a private method to unify the copy/pasted code.
* Reland "Nnbd widgets (#64672)"
This reverts commit 127e67902e8bbb0dcbfb3351b8fd00f7cbdf0178.
* remove non-nullable enforcement on AsyncSnapshot
* make data param non-nullable for AsyncSnapshot.withData
* make some Text params non-nullable
* migrate widget to nullsafety
* remove double blank line after license
* address review comments in actions.dart
* nullable ObjectKey.value
* use local variable oldElement
* make State.build non-nullable
* make State.context non-nullable
* newline at eof
* make ProxyWidget.child non-nullable
* make _InactiveElements.debugContains non-nullable
* make Element.depth non-nullable
* make ProxyElement.build non-nullable
* make StatefulElement.state non-nullable
* remove 'Notice that'
* avoid cast of list in RenderObjectElement.updateChildren
* make IndexedSlot.value non-nullable
* avoid cast of list in MultiChildRenderObjectElement.mount
* make some WidgetsApp parameters non-nullable
* hitTest take non-nullable position
* make ScrollableState.position non-nullable
* use _pixels instead of pixels
* make ViewportOffset.pixels non-nullable
* make param and return type of IndexedWidgetBuilder non-nullable
* unused_import
* make context param non-nullable for Builder in animated_list.dart
* make ScrollMetrics.viewportDimension non-nullable
* make ScrollMetrics.{min,max}ScrollExtent non-nullable
* make _Location.file non-nullable
* _WidgetForTypeTests.createElement throw UnimplementedError
* update _NullWidget.build error message
* make _ShortcutsState.manager non-nullable
* Fix childCount issues for NNBD
* fix childCount computation on web
* increase max value on js side to compute childCount
* make aspect parameter of dependOnInheritedWidgetOfExactType nullable
* merge has{min,max}ScrollExtent into hasScrollExtents
* update focus_manager.dart
* address review comments in icon.dart
* address review comments in image.dart
* address review comments in routes.dart
* address review comments in scroll_activity.dart
* update doc comments
* make UserScrollNotification.direction non-nullable and required
* rename hasScrollExtents to hasContentDimensions
* unnecessary late
Co-authored-by: Ian Hickson <ian@hixie.ch>
* Add clipBehavior to RenderFlex
* Add clipBehavior to FittedBox
* Add clipBehavior to Flex and FittedBox
* Add clipBehavior to UnconstrainedBox
* Add clipBehavior to Stack and Wrap
* Add clipBehavior to TextEditable
* Add clipBehavior to ListWheelScrollView
* Add clipBehavior to SingleChildScrollView
* Add clipBehavior to RenderViewportBase's widgets
Those widgets are NestedScrollView and ShrinkWrappingViewport.
* Fix tests
* Remove enum Overflow and fix typo
* Remove clipToSize
* Analyze fix
* Remove Mixin and other small fixes
* Fix tests and respect Stack's default clipBehavior
* Add Overflow back to make it non-breaking
* Restore clipBehavior to make it non-breaking
* Small fixes
* Fix rebase
* Reland "Fix custom Elements that wants to decorate State.build (#49925)" (#50068)"
This reverts commit 62fdcb031945c23dacb481bd464cbea8ec9037d4.
Updates stack filtering for new frames in stateful element
* Update project.pbxproj files to say Flutter rather than Chromium
Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
* Update the copyright notice checker to require a standard notice on all files
* Update copyrights on Dart files. (This was a mechanical commit.)
* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).
* Clean up the copyrights in non-Dart files. (Manual edits.)
Also, make sure templates don't have copyrights.
* Fix some more ORGANIZATIONNAMEs
* Add structured errors in Animations, TabView, ChangeNotifier
* Add structured error on MaterialPageRoute, BoxBorder, DecorationImagePainter, TextSpan
* Add structured errors in Debug
* Fix test errors
* Add structured errors in Scaffold and Stepper
* Add structured errors in part of Rendering Layer
* Fix failing test due to FloatingPoint precision
* Fix failing tests due to precision error and not using final
* Fix failing test due to floating precision error with RegEx instead
* Add structured error in CustomLayout and increase test coverage
* Add structured error & its test in ListBody
* Add structured error in ProxyBox and increase test coverage
* Add structured error message in Viewport
* Fix styles and add more assertions on ErrorHint and DiagnosticProperty
* Add structured error in scheduler/binding and scheduler/ticker
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in AssetBundle and TextInput
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured errors in several widgets #1
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove unused import
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add assertions on hint messages
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix catch spacing
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in several widgets part 2 and increase code coverage
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in flutter_test/widget_tester
* Fix floating precision accuracy by using RegExp
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove todo to add tests in Scaffold showBottomSheet
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix reviews by indenting lines and fixing the assertion orders
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix failing tests due to renaming class
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Try skipping the NetworkBundleTest
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove leading space in material/debug error hint
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>