Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2edb685b
Unverified
Commit
2edb685b
authored
Mar 24, 2021
by
xubaolin
Committed by
GitHub
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Object? instead of dynamic for Element slots (#78928)
parent
975fb0f0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
38 additions
and
38 deletions
+38
-38
action_sheet.dart
packages/flutter/lib/src/cupertino/action_sheet.dart
+1
-1
dialog.dart
packages/flutter/lib/src/cupertino/dialog.dart
+1
-1
text_selection_toolbar.dart
...ges/flutter/lib/src/cupertino/text_selection_toolbar.dart
+3
-3
chip.dart
packages/flutter/lib/src/material/chip.dart
+2
-2
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+2
-2
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+2
-2
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+4
-4
layout_builder.dart
packages/flutter/lib/src/widgets/layout_builder.dart
+4
-4
list_wheel_scroll_view.dart
packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart
+2
-2
sliver.dart
packages/flutter/lib/src/widgets/sliver.dart
+1
-1
sliver_persistent_header.dart
...ges/flutter/lib/src/widgets/sliver_persistent_header.dart
+4
-4
sliver_prototype_extent_list.dart
...flutter/lib/src/widgets/sliver_prototype_extent_list.dart
+4
-4
viewport.dart
packages/flutter/lib/src/widgets/viewport.dart
+1
-1
render_object_element_test.dart
...ages/flutter/test/widgets/render_object_element_test.dart
+7
-7
No files found.
packages/flutter/lib/src/cupertino/action_sheet.dart
View file @
2edb685b
...
...
@@ -489,7 +489,7 @@ class _CupertinoAlertRenderElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_contentElement
=
updateChild
(
_contentElement
,
widget
.
contentSection
,
_AlertSections
.
contentSection
);
...
...
packages/flutter/lib/src/cupertino/dialog.dart
View file @
2edb685b
...
...
@@ -389,7 +389,7 @@ class _CupertinoDialogRenderElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_contentElement
=
updateChild
(
_contentElement
,
widget
.
contentSection
,
_AlertDialogSections
.
contentSection
);
_actionsElement
=
updateChild
(
_actionsElement
,
widget
.
actionsSection
,
_AlertDialogSections
.
actionsSection
);
...
...
packages/flutter/lib/src/cupertino/text_selection_toolbar.dart
View file @
2edb685b
...
...
@@ -535,7 +535,7 @@ class _CupertinoTextSelectionToolbarItemsElement extends RenderObjectElement {
}
@override
void
insertRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
insertRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
if
(
slot
is
_CupertinoTextSelectionToolbarItemsSlot
)
{
assert
(
child
is
RenderBox
);
_updateRenderObject
(
child
as
RenderBox
,
slot
);
...
...
@@ -562,7 +562,7 @@ class _CupertinoTextSelectionToolbarItemsElement extends RenderObjectElement {
}
@override
void
removeRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
// Check if the child is in a slot.
if
(
slot
is
_CupertinoTextSelectionToolbarItemsSlot
)
{
assert
(
child
is
RenderBox
);
...
...
@@ -614,7 +614,7 @@ class _CupertinoTextSelectionToolbarItemsElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
// Mount slotted children.
_mountChild
(
widget
.
backButton
,
_CupertinoTextSelectionToolbarItemsSlot
.
backButton
);
...
...
packages/flutter/lib/src/material/chip.dart
View file @
2edb685b
...
...
@@ -2189,7 +2189,7 @@ class _RenderChipElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_mountChild
(
widget
.
theme
.
avatar
,
_ChipSlot
.
avatar
);
_mountChild
(
widget
.
theme
.
deleteIcon
,
_ChipSlot
.
deleteIcon
);
...
...
@@ -2246,7 +2246,7 @@ class _RenderChipElement extends RenderObjectElement {
}
@override
void
moveRenderObjectChild
(
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
,
'not reachable'
);
}
}
...
...
packages/flutter/lib/src/material/input_decorator.dart
View file @
2edb685b
...
...
@@ -1588,7 +1588,7 @@ class _DecorationElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_mountChild
(
widget
.
decoration
.
icon
,
_DecorationSlot
.
icon
);
_mountChild
(
widget
.
decoration
.
input
,
_DecorationSlot
.
input
);
...
...
@@ -1685,7 +1685,7 @@ class _DecorationElement extends RenderObjectElement {
}
@override
void
moveRenderObjectChild
(
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
,
'not reachable'
);
}
}
...
...
packages/flutter/lib/src/material/list_tile.dart
View file @
2edb685b
...
...
@@ -1327,7 +1327,7 @@ class _ListTileElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_mountChild
(
widget
.
leading
,
_ListTileSlot
.
leading
);
_mountChild
(
widget
.
title
,
_ListTileSlot
.
title
);
...
...
@@ -1389,7 +1389,7 @@ class _ListTileElement extends RenderObjectElement {
}
@override
void
moveRenderObjectChild
(
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
,
'not reachable'
);
}
}
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
2edb685b
...
...
@@ -1153,7 +1153,7 @@ class RenderObjectToWidgetElement<T extends RenderObject> extends RootRenderObje
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
assert
(
parent
==
null
);
super
.
mount
(
parent
,
newSlot
);
_rebuild
();
...
...
@@ -1204,19 +1204,19 @@ class RenderObjectToWidgetElement<T extends RenderObject> extends RootRenderObje
RenderObjectWithChildMixin
<
T
>
get
renderObject
=>
super
.
renderObject
as
RenderObjectWithChildMixin
<
T
>;
@override
void
insertRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
insertRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
assert
(
slot
==
_rootChildSlot
);
assert
(
renderObject
.
debugValidateChild
(
child
));
renderObject
.
child
=
child
as
T
;
}
@override
void
moveRenderObjectChild
(
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
);
}
@override
void
removeRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
assert
(
renderObject
.
child
==
child
);
renderObject
.
child
=
null
;
}
...
...
packages/flutter/lib/src/widgets/layout_builder.dart
View file @
2edb685b
...
...
@@ -79,7 +79,7 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
// Creates the renderObject.
renderObject
.
updateCallback
(
_layout
);
}
...
...
@@ -152,7 +152,7 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
}
@override
void
insertRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
insertRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
final
RenderObjectWithChildMixin
<
RenderObject
>
renderObject
=
this
.
renderObject
;
assert
(
slot
==
null
);
assert
(
renderObject
.
debugValidateChild
(
child
));
...
...
@@ -161,12 +161,12 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
}
@override
void
moveRenderObjectChild
(
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
);
}
@override
void
removeRenderObjectChild
(
RenderObject
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
RenderObject
child
,
Object
?
slot
)
{
final
RenderConstrainedLayoutBuilder
<
ConstraintType
,
RenderObject
>
renderObject
=
this
.
renderObject
;
assert
(
renderObject
.
child
==
child
);
renderObject
.
child
=
null
;
...
...
packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart
View file @
2edb685b
...
...
@@ -889,12 +889,12 @@ class ListWheelElement extends RenderObjectElement implements ListWheelChildMana
}
@override
Element
?
updateChild
(
Element
?
child
,
Widget
?
newWidget
,
dynamic
newSlot
)
{
Element
?
updateChild
(
Element
?
child
,
Widget
?
newWidget
,
Object
?
newSlot
)
{
final
ListWheelParentData
?
oldParentData
=
child
?.
renderObject
?.
parentData
as
ListWheelParentData
?;
final
Element
?
newChild
=
super
.
updateChild
(
child
,
newWidget
,
newSlot
);
final
ListWheelParentData
?
newParentData
=
newChild
?.
renderObject
?.
parentData
as
ListWheelParentData
?;
if
(
newParentData
!=
null
)
{
newParentData
.
index
=
newSlot
as
int
;
newParentData
.
index
=
newSlot
!
as
int
;
if
(
oldParentData
!=
null
)
newParentData
.
offset
=
oldParentData
.
offset
;
}
...
...
packages/flutter/lib/src/widgets/sliver.dart
View file @
2edb685b
...
...
@@ -1236,7 +1236,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
}
@override
Element
?
updateChild
(
Element
?
child
,
Widget
?
newWidget
,
dynamic
newSlot
)
{
Element
?
updateChild
(
Element
?
child
,
Widget
?
newWidget
,
Object
?
newSlot
)
{
final
SliverMultiBoxAdaptorParentData
?
oldParentData
=
child
?.
renderObject
?.
parentData
as
SliverMultiBoxAdaptorParentData
?;
final
Element
?
newChild
=
super
.
updateChild
(
child
,
newWidget
,
newSlot
);
final
SliverMultiBoxAdaptorParentData
?
newParentData
=
newChild
?.
renderObject
?.
parentData
as
SliverMultiBoxAdaptorParentData
?;
...
...
packages/flutter/lib/src/widgets/sliver_persistent_header.dart
View file @
2edb685b
...
...
@@ -195,7 +195,7 @@ class _SliverPersistentHeaderElement extends RenderObjectElement {
_RenderSliverPersistentHeaderForWidgetsMixin
get
renderObject
=>
super
.
renderObject
as
_RenderSliverPersistentHeaderForWidgetsMixin
;
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
renderObject
.
_element
=
this
;
}
...
...
@@ -247,18 +247,18 @@ class _SliverPersistentHeaderElement extends RenderObjectElement {
}
@override
void
insertRenderObjectChild
(
covariant
RenderBox
child
,
dynamic
slot
)
{
void
insertRenderObjectChild
(
covariant
RenderBox
child
,
Object
?
slot
)
{
assert
(
renderObject
.
debugValidateChild
(
child
));
renderObject
.
child
=
child
;
}
@override
void
moveRenderObjectChild
(
covariant
RenderObject
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
covariant
RenderObject
child
,
Object
?
oldSlot
,
Object
?
newSlot
)
{
assert
(
false
);
}
@override
void
removeRenderObjectChild
(
covariant
RenderObject
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
covariant
RenderObject
child
,
Object
?
slot
)
{
renderObject
.
child
=
null
;
}
...
...
packages/flutter/lib/src/widgets/sliver_prototype_extent_list.dart
View file @
2edb685b
...
...
@@ -72,7 +72,7 @@ class _SliverPrototypeExtentListElement extends SliverMultiBoxAdaptorElement {
static
final
Object
_prototypeSlot
=
Object
();
@override
void
insertRenderObjectChild
(
covariant
RenderObject
child
,
covariant
dynamic
slot
)
{
void
insertRenderObjectChild
(
covariant
RenderObject
child
,
covariant
Object
slot
)
{
if
(
slot
==
_prototypeSlot
)
{
assert
(
child
is
RenderBox
);
renderObject
.
child
=
child
as
RenderBox
;
...
...
@@ -88,7 +88,7 @@ class _SliverPrototypeExtentListElement extends SliverMultiBoxAdaptorElement {
}
@override
void
moveRenderObjectChild
(
RenderBox
child
,
dynamic
oldSlot
,
dynamic
newSlot
)
{
void
moveRenderObjectChild
(
RenderBox
child
,
Object
oldSlot
,
Object
newSlot
)
{
if
(
newSlot
==
_prototypeSlot
)
assert
(
false
);
// There's only one prototype child so it cannot be moved.
else
...
...
@@ -96,7 +96,7 @@ class _SliverPrototypeExtentListElement extends SliverMultiBoxAdaptorElement {
}
@override
void
removeRenderObjectChild
(
RenderBox
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
RenderBox
child
,
Object
slot
)
{
if
(
renderObject
.
child
==
child
)
renderObject
.
child
=
null
;
else
...
...
@@ -111,7 +111,7 @@ class _SliverPrototypeExtentListElement extends SliverMultiBoxAdaptorElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_prototype
=
updateChild
(
_prototype
,
widget
.
prototypeItem
,
_prototypeSlot
);
}
...
...
packages/flutter/lib/src/widgets/viewport.dart
View file @
2edb685b
...
...
@@ -218,7 +218,7 @@ class _ViewportElement extends MultiChildRenderObjectElement {
RenderViewport
get
renderObject
=>
super
.
renderObject
as
RenderViewport
;
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_updateCenter
();
}
...
...
packages/flutter/test/widgets/render_object_element_test.dart
View file @
2edb685b
...
...
@@ -104,7 +104,7 @@ abstract class SwapperElement extends RenderObjectElement {
}
@override
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
void
mount
(
Element
?
parent
,
Object
?
newSlot
)
{
super
.
mount
(
parent
,
newSlot
);
_updateChildren
(
widget
);
}
...
...
@@ -120,13 +120,13 @@ class SwapperElementWithProperOverrides extends SwapperElement {
SwapperElementWithProperOverrides
(
Swapper
widget
)
:
super
(
widget
);
@override
void
insertRenderObjectChild
(
RenderBox
child
,
dynamic
slot
)
{
void
insertRenderObjectChild
(
RenderBox
child
,
Object
?
slot
)
{
insertSlots
.
add
(
slot
);
assert
(
child
!=
null
);
if
(
slot
==
'stable'
)
renderObject
.
stable
=
child
;
else
renderObject
.
setSwapper
(
child
,
slot
as
bool
);
renderObject
.
setSwapper
(
child
,
slot
!
as
bool
);
}
@override
...
...
@@ -137,12 +137,12 @@ class SwapperElementWithProperOverrides extends SwapperElement {
}
@override
void
removeRenderObjectChild
(
RenderBox
child
,
dynamic
slot
)
{
void
removeRenderObjectChild
(
RenderBox
child
,
Object
?
slot
)
{
removeSlots
.
add
(
slot
);
if
(
slot
==
'stable'
)
renderObject
.
stable
=
null
;
else
renderObject
.
setSwapper
(
null
,
slot
as
bool
);
renderObject
.
setSwapper
(
null
,
slot
!
as
bool
);
}
}
...
...
@@ -155,13 +155,13 @@ class SwapperElementWithDeprecatedOverrides extends SwapperElement {
@override
// ignore: must_call_super
void
insertChildRenderObject
(
RenderBox
child
,
dynamic
slot
)
{
void
insertChildRenderObject
(
RenderBox
child
,
Object
?
slot
)
{
insertSlots
.
add
(
slot
);
assert
(
child
!=
null
);
if
(
slot
==
'stable'
)
renderObject
.
stable
=
child
;
else
renderObject
.
setSwapper
(
child
,
slot
as
bool
);
renderObject
.
setSwapper
(
child
,
slot
!
as
bool
);
}
@override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment