85 Commits

Author SHA1 Message Date
Ren You
63c49c3d83
Revert "Dispose render objects when owning element is unmounted. (#82883)" (#83790)
This reverts commit c75edc268ca336c66a103f1c0d82c4dff140fca0.
2021-06-02 07:54:19 -07:00
Dan Field
c75edc268c
Dispose render objects when owning element is unmounted. (#82883) 2021-06-01 22:29:02 -07:00
Michael Goderbauer
7b9a175557
Assert when duplicated keys are introduced in subsequent build (#81850) (#82201) 2021-05-11 09:41:02 -07:00
Michael Goderbauer
b8a2456737
Enable library_private_types_in_public_api lint (#81578) 2021-05-10 16:26:16 -07:00
Hans Muller
dbc8826816
Revert "Assert when duplicated keys are introduced in subsequent build (#81850)" (#82039)
This reverts commit 3ab799bbc934e5f6d032557cdcb1486ce6b93c4b.
2021-05-07 10:19:47 -07:00
Michael Goderbauer
3ab799bbc9
Assert when duplicated keys are introduced in subsequent build (#81850) 2021-05-06 19:49:02 -07:00
Todd Volkert
efc079657b
Allow reuse of NavigatorObserver in Navigator.observers (#81601) 2021-05-06 19:39:03 -07:00
Alexandre Ardhuin
1a3af88ced
add missing trailing commas (#81362) 2021-04-28 10:54:05 -07:00
Phil Quitslund
61c30c41b2
fix sort_directives violations (#80817) 2021-04-21 13:49:03 -07:00
Michael Goderbauer
ac8e1f8fc4
Reduce severity of memory leak when BuildContext/Element is retained (#79957) 2021-04-08 15:49:02 -07:00
Alexandre Ardhuin
8de7020a5f
remove unnecessary trailing commas (#79562) 2021-04-01 21:52:35 +02:00
Tong Mu
c4ba26e31b
Revert "Let InkWell/Ink/ancestor support GlobalKey so that splash does not stop when changing position. (#71138)" (#79300)
This reverts commit e7266dbb079d31fff0f886518c6a1b25bf89bb94.
2021-03-29 13:12:18 -07:00
YeungKC
e7266dbb07
Let InkWell/Ink/ancestor support GlobalKey so that splash does not stop when changing position. (#71138) 2021-03-26 19:39:01 -07:00
xubaolin
74eb9df21a
Check if MultiChildRenderObjectElement has an associated RO (#78854) 2021-03-25 19:29:03 -07:00
Michael Goderbauer
ed755fba5e
Enable avoid_unnecessary_containers lint (#77294) 2021-03-04 15:29:03 -08:00
Greg Spencer
c6ef4c75d9
Turn on sized_box_for_whitespace lint, fix instances. (#77099) 2021-03-03 17:29:02 -08:00
Michael Goderbauer
0f568298d8
enable use_key_in_widget_constructors lint (#77032) 2021-03-02 10:14:02 -08:00
Sam Rawlins
d69845b17f
Remove "unnecessary" imports in test/widgets (#75949) 2021-02-16 13:56:04 -08:00
Todd Volkert
835c7fab45
Fix FocusManager constructor (#75894)
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.
2021-02-12 17:19:20 -08:00
Todd Volkert
5584fce36e
Switch global key registry to be owned by the build owner. (#74701)
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.
2021-01-26 14:28:58 -08:00
Michael Goderbauer
24d434d156
Revert "Revert "Fix _LateInitializationError for RenderObjectElement.renderObject (#70974)" (#73575)" (#73580) 2021-01-08 12:49:04 -08:00
Michael Goderbauer
edfb6305d8
Revert "Fix _LateInitializationError for RenderObjectElement.renderObject (#70974)" (#73575)
This reverts commit c243d834ce41bc5d279b0264efbc6b3c9e0df53d.
2021-01-08 10:24:10 -08:00
Michael Goderbauer
c243d834ce
Fix _LateInitializationError for RenderObjectElement.renderObject (#70974) 2021-01-08 09:35:10 -08:00
Todd Volkert
a1070e4f4c
Revert "Remove duplicate code in Element.rebuild() and BuildOwner.buildScope() (#71940)" (#72120)
This reverts commit c8f07aad563d9460eac0074be0a24a38158239af.
2020-12-10 23:24:21 -08:00
Todd Volkert
c8f07aad56
Remove duplicate code in Element.rebuild() and BuildOwner.buildScope() (#71940)
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.
2020-12-08 17:58:28 -08:00
Todd Volkert
7ec3f6bdf9
Make FocusManager configurable in BuildOwner (#71872) 2020-12-08 12:42:39 -08:00
Michael Goderbauer
7a3a29e71f
Fixes Intrinsics for RenderParagraph and RenderWrap (#70656) 2020-11-20 17:24:58 -08:00
Darren Austin
7ce0dce2e5
Migrate even more Material framework tests to null safety. (#67849) 2020-10-12 11:30:26 -07:00
Alexandre Ardhuin
b007a81ad4
Reland "Nnbd widgets" (#65528)
* 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
2020-09-15 16:42:00 +02:00
Michael Goderbauer
127e67902e
Revert "Nnbd widgets (#64672)" (#65488)
This reverts commit e682ec711a8c05fe78157595240b392de339fa32.
2020-09-09 15:18:54 -07:00
Alexandre Ardhuin
e682ec711a
Nnbd widgets (#64672)
* 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>
2020-09-09 10:52:27 +02:00
xubaolin
aa1acd8e54
Ignore unmounted parent when _debugVerifyGlobalKeyReservation for GlobalKey check (#62323)
* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)

* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)

* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)

* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)

* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)

* Ignore unmounted parent when _debugVerifyGlobalKeyReservation (#62055)
2020-07-30 10:07:18 -07:00
liyuqian
42e02d60d3
Reland non-breaking "Add clipBehavior to widgets with clipRect #55977" (#59364)
* Revert "Revert "Add clipBehavior to widgets with clipRect (#55977)" (#58344)"

This reverts commit 1d395c5e187370f2838bb043d3b438029b484bfc.

* Add missed Overflow
2020-06-17 10:57:40 -07:00
Alexandre Ardhuin
4d7525f05c
Opt out nnbd in packages/flutter (#59186)
* add language version 2.8 in packages/flutter

* enable non-nullable analyzer flag
2020-06-11 14:11:30 +02:00
Darren Austin
012cee2731
Typo fixing sweep through packages/flutter. (#59219) 2020-06-11 05:10:01 -07:00
Ian Hickson
67881172fd
Error message improvements (#58204) 2020-06-02 18:03:03 -07:00
Mehmet Fidanboylu
1d395c5e18
Revert "Add clipBehavior to widgets with clipRect (#55977)" (#58344)
This reverts commit cd593dae1961ca2bc5c045a310f16e6cdffc8294.
2020-05-31 07:41:50 -07:00
liyuqian
cd593dae19
Add clipBehavior to widgets with clipRect (#55977)
* 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
2020-05-29 15:38:50 -07:00
Remi Rousselet
c742c19891
Add debugDoingBuild flag (#51428) 2020-03-02 09:55:37 -08:00
Dan Field
26619b3c35
Reland #49925 (#50071)
* 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
2020-02-03 20:39:49 -08:00
Jenn Magder
62fdcb0319
Revert "Fix custom Elements that wants to decorate State.build (#49925)" (#50068)
This reverts commit a1143d174f0e97b1fb831bcf87f438d07f2351d7.
2020-02-03 16:42:47 -08:00
Remi Rousselet
a1143d174f
Fix custom Elements that wants to decorate State.build (#49925) 2020-02-03 14:38:07 -08:00
chunhtai
2dc71a343f
reland Refactors global key duplication detection (#49896)
* reland "Refactors global key duplication detection (#46183)"

This reverts commit d2b66dbfcfdad68473fc4366e3042cd2e17706ac.

* fix test
2020-01-31 12:51:42 -08:00
Jonah Williams
d2b66dbfcf
Revert "Refactors global key duplication detection (#46183)" (#49847)
This reverts commit 340b193f20e85f2cfbebf84fe315112985a38a13.
2020-01-30 17:02:16 -08:00
chunhtai
340b193f20
Refactors global key duplication detection (#46183) 2020-01-30 14:23:02 -08:00
Dan Field
7aec9b4602
Avoid calling didChangeDependences on a State that has dropped out of the tree (#49527) 2020-01-29 14:33:01 -08:00
Alexandre Ardhuin
1fc43d9330
add key to constructors of public widgets (#47884)
* add key to constructors of public widgets

* fix a test

* fix a test
2020-01-06 17:41:54 +01:00
Alexandre Ardhuin
dfbd585668 implicit-casts:false in flutter/test (#46245) 2019-12-16 15:03:02 -08:00
Ian Hickson
449f4a6673
License update (#45373)
* 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
2019-11-27 15:04:02 -08:00
Albertus Angga Raharja
b31ca1aaca
Add more structure to errors (continuation of #34684) (#42640)
* 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>
2019-10-28 11:00:49 -07:00