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
726eff49
Commit
726eff49
authored
Mar 12, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rename fixit] *OneChild* -> *SingleChild*
Fixes #1482
parent
e71bd77e
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
83 additions
and
83 deletions
+83
-83
custom_render_box.dart
examples/layers/widgets/custom_render_box.dart
+1
-1
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+2
-2
material.dart
packages/flutter/lib/src/material/material.dart
+1
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+2
-2
tooltip.dart
packages/flutter/lib/src/material/tooltip.dart
+2
-2
custom_layout.dart
packages/flutter/lib/src/rendering/custom_layout.dart
+1
-1
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+8
-8
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+36
-36
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+7
-7
gesture_detector.dart
packages/flutter/lib/src/widgets/gesture_detector.dart
+1
-1
custom_one_child_layout_test.dart
...ges/flutter/test/widget/custom_one_child_layout_test.dart
+9
-9
render_object_widget_test.dart
packages/flutter/test/widget/render_object_widget_test.dart
+10
-10
stateful_component_test.dart
packages/flutter/test/widget/stateful_component_test.dart
+2
-2
sprite_widget.dart
packages/flutter_sprites/lib/src/sprite_widget.dart
+1
-1
No files found.
examples/layers/widgets/custom_render_box.dart
View file @
726eff49
...
@@ -35,7 +35,7 @@ class RenderDots extends RenderConstrainedBox {
...
@@ -35,7 +35,7 @@ class RenderDots extends RenderConstrainedBox {
}
}
}
}
class
Dots
extends
On
eChildRenderObjectWidget
{
class
Dots
extends
Singl
eChildRenderObjectWidget
{
Dots
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
Dots
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderDots
createRenderObject
(
BuildContext
context
)
=>
new
RenderDots
();
RenderDots
createRenderObject
(
BuildContext
context
)
=>
new
RenderDots
();
}
}
...
...
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
726eff49
...
@@ -94,7 +94,7 @@ class _BottomSheetState extends State<BottomSheet> {
...
@@ -94,7 +94,7 @@ class _BottomSheetState extends State<BottomSheet> {
// MODAL BOTTOM SHEETS
// MODAL BOTTOM SHEETS
class
_ModalBottomSheetLayout
extends
On
eChildLayoutDelegate
{
class
_ModalBottomSheetLayout
extends
Singl
eChildLayoutDelegate
{
_ModalBottomSheetLayout
(
this
.
progress
);
_ModalBottomSheetLayout
(
this
.
progress
);
final
double
progress
;
final
double
progress
;
...
@@ -133,7 +133,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
...
@@ -133,7 +133,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
animation:
config
.
route
.
animation
,
animation:
config
.
route
.
animation
,
builder:
(
BuildContext
context
,
Widget
child
)
{
builder:
(
BuildContext
context
,
Widget
child
)
{
return
new
ClipRect
(
return
new
ClipRect
(
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_ModalBottomSheetLayout
(
config
.
route
.
animation
.
value
),
delegate:
new
_ModalBottomSheetLayout
(
config
.
route
.
animation
.
value
),
child:
new
BottomSheet
(
child:
new
BottomSheet
(
animationController:
config
.
route
.
animation
,
animationController:
config
.
route
.
animation
,
...
...
packages/flutter/lib/src/material/material.dart
View file @
726eff49
...
@@ -274,7 +274,7 @@ class RenderInkFeatures extends RenderProxyBox implements MaterialInkController
...
@@ -274,7 +274,7 @@ class RenderInkFeatures extends RenderProxyBox implements MaterialInkController
}
}
}
}
class
InkFeatures
extends
On
eChildRenderObjectWidget
{
class
InkFeatures
extends
Singl
eChildRenderObjectWidget
{
InkFeatures
({
Key
key
,
this
.
color
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
InkFeatures
({
Key
key
,
this
.
color
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
final
Color
color
;
final
Color
color
;
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
726eff49
...
@@ -233,7 +233,7 @@ class _PopupMenu<T> extends StatelessComponent {
...
@@ -233,7 +233,7 @@ class _PopupMenu<T> extends StatelessComponent {
}
}
}
}
class
_PopupMenuRouteLayout
extends
On
eChildLayoutDelegate
{
class
_PopupMenuRouteLayout
extends
Singl
eChildLayoutDelegate
{
_PopupMenuRouteLayout
(
this
.
position
,
this
.
selectedItemOffset
);
_PopupMenuRouteLayout
(
this
.
position
,
this
.
selectedItemOffset
);
final
ModalPosition
position
;
final
ModalPosition
position
;
...
@@ -316,7 +316,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
...
@@ -316,7 +316,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
final
Size
screenSize
=
MediaQuery
.
of
(
context
).
size
;
final
Size
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
new
ConstrainedBox
(
return
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
maxWidth:
screenSize
.
width
,
maxHeight:
screenSize
.
height
),
constraints:
new
BoxConstraints
(
maxWidth:
screenSize
.
width
,
maxHeight:
screenSize
.
height
),
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_PopupMenuRouteLayout
(
position
,
selectedItemOffset
),
delegate:
new
_PopupMenuRouteLayout
(
position
,
selectedItemOffset
),
child:
new
_PopupMenu
<
T
>(
route:
this
)
child:
new
_PopupMenu
<
T
>(
route:
this
)
)
)
...
...
packages/flutter/lib/src/material/tooltip.dart
View file @
726eff49
...
@@ -189,7 +189,7 @@ class _TooltipState extends State<Tooltip> {
...
@@ -189,7 +189,7 @@ class _TooltipState extends State<Tooltip> {
}
}
}
}
class
_TooltipPositionDelegate
extends
On
eChildLayoutDelegate
{
class
_TooltipPositionDelegate
extends
Singl
eChildLayoutDelegate
{
_TooltipPositionDelegate
({
_TooltipPositionDelegate
({
this
.
target
,
this
.
target
,
this
.
verticalOffset
,
this
.
verticalOffset
,
...
@@ -271,7 +271,7 @@ class _TooltipOverlay extends StatelessComponent {
...
@@ -271,7 +271,7 @@ class _TooltipOverlay extends StatelessComponent {
right:
0.0
,
right:
0.0
,
bottom:
0.0
,
bottom:
0.0
,
child:
new
IgnorePointer
(
child:
new
IgnorePointer
(
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_TooltipPositionDelegate
(
delegate:
new
_TooltipPositionDelegate
(
target:
target
,
target:
target
,
verticalOffset:
verticalOffset
,
verticalOffset:
verticalOffset
,
...
...
packages/flutter/lib/src/rendering/custom_layout.dart
View file @
726eff49
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
import
'box.dart'
;
import
'box.dart'
;
import
'object.dart'
;
import
'object.dart'
;
// For
OneChildLayoutDelegate and RenderCustomOn
eChildLayoutBox, see shifted_box.dart
// For
SingleChildLayoutDelegate and RenderCustomSingl
eChildLayoutBox, see shifted_box.dart
/// [ParentData] used by [RenderCustomMultiChildLayoutBox].
/// [ParentData] used by [RenderCustomMultiChildLayoutBox].
class
MultiChildLayoutParentData
extends
ContainerBoxParentDataMixin
<
RenderBox
>
{
class
MultiChildLayoutParentData
extends
ContainerBoxParentDataMixin
<
RenderBox
>
{
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
726eff49
...
@@ -506,7 +506,7 @@ class RenderOverflowBox extends RenderShiftedBox {
...
@@ -506,7 +506,7 @@ class RenderOverflowBox extends RenderShiftedBox {
}
}
/// A delegate for computing the layout of a render object with a single child.
/// A delegate for computing the layout of a render object with a single child.
class
On
eChildLayoutDelegate
{
class
Singl
eChildLayoutDelegate
{
/// Returns the size of this object given the incoming constraints.
/// Returns the size of this object given the incoming constraints.
Size
getSize
(
BoxConstraints
constraints
)
=>
constraints
.
biggest
;
Size
getSize
(
BoxConstraints
constraints
)
=>
constraints
.
biggest
;
...
@@ -517,7 +517,7 @@ class OneChildLayoutDelegate {
...
@@ -517,7 +517,7 @@ class OneChildLayoutDelegate {
Offset
getPositionForChild
(
Size
size
,
Size
childSize
)
=>
Offset
.
zero
;
Offset
getPositionForChild
(
Size
size
,
Size
childSize
)
=>
Offset
.
zero
;
/// Override this method to return true when the child needs to be laid out.
/// Override this method to return true when the child needs to be laid out.
bool
shouldRelayout
(
On
eChildLayoutDelegate
oldDelegate
)
=>
true
;
bool
shouldRelayout
(
Singl
eChildLayoutDelegate
oldDelegate
)
=>
true
;
}
}
/// Defers the layout of its single child to a delegate.
/// Defers the layout of its single child to a delegate.
...
@@ -526,18 +526,18 @@ class OneChildLayoutDelegate {
...
@@ -526,18 +526,18 @@ class OneChildLayoutDelegate {
/// decide where to position the child. The delegate can also determine the size
/// decide where to position the child. The delegate can also determine the size
/// of the parent, but the size of the parent cannot depend on the size of the
/// of the parent, but the size of the parent cannot depend on the size of the
/// child.
/// child.
class
RenderCustom
On
eChildLayoutBox
extends
RenderShiftedBox
{
class
RenderCustom
Singl
eChildLayoutBox
extends
RenderShiftedBox
{
RenderCustom
On
eChildLayoutBox
({
RenderCustom
Singl
eChildLayoutBox
({
RenderBox
child
,
RenderBox
child
,
On
eChildLayoutDelegate
delegate
Singl
eChildLayoutDelegate
delegate
})
:
_delegate
=
delegate
,
super
(
child
)
{
})
:
_delegate
=
delegate
,
super
(
child
)
{
assert
(
delegate
!=
null
);
assert
(
delegate
!=
null
);
}
}
/// A delegate that controls this object's layout.
/// A delegate that controls this object's layout.
On
eChildLayoutDelegate
get
delegate
=>
_delegate
;
Singl
eChildLayoutDelegate
get
delegate
=>
_delegate
;
On
eChildLayoutDelegate
_delegate
;
Singl
eChildLayoutDelegate
_delegate
;
void
set
delegate
(
On
eChildLayoutDelegate
newDelegate
)
{
void
set
delegate
(
Singl
eChildLayoutDelegate
newDelegate
)
{
assert
(
newDelegate
!=
null
);
assert
(
newDelegate
!=
null
);
if
(
_delegate
==
newDelegate
)
if
(
_delegate
==
newDelegate
)
return
;
return
;
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
726eff49
...
@@ -27,7 +27,7 @@ export 'package:flutter/rendering.dart' show
...
@@ -27,7 +27,7 @@ export 'package:flutter/rendering.dart' show
HitTestBehavior
,
HitTestBehavior
,
MaxTileWidthGridDelegate
,
MaxTileWidthGridDelegate
,
MultiChildLayoutDelegate
,
MultiChildLayoutDelegate
,
On
eChildLayoutDelegate
,
Singl
eChildLayoutDelegate
,
RenderObjectPainter
,
RenderObjectPainter
,
PaintingContext
,
PaintingContext
,
PlainTextSpan
,
PlainTextSpan
,
...
@@ -56,7 +56,7 @@ export 'package:flutter/rendering.dart' show
...
@@ -56,7 +56,7 @@ export 'package:flutter/rendering.dart' show
///
///
/// This class is relatively expensive because it requires painting the child
/// This class is relatively expensive because it requires painting the child
/// into an intermediate buffer.
/// into an intermediate buffer.
class
Opacity
extends
On
eChildRenderObjectWidget
{
class
Opacity
extends
Singl
eChildRenderObjectWidget
{
Opacity
({
Key
key
,
this
.
opacity
,
Widget
child
})
Opacity
({
Key
key
,
this
.
opacity
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
opacity
>=
0.0
&&
opacity
<=
1.0
);
assert
(
opacity
>=
0.0
&&
opacity
<=
1.0
);
...
@@ -80,7 +80,7 @@ class Opacity extends OneChildRenderObjectWidget {
...
@@ -80,7 +80,7 @@ class Opacity extends OneChildRenderObjectWidget {
}
}
}
}
class
ShaderMask
extends
On
eChildRenderObjectWidget
{
class
ShaderMask
extends
Singl
eChildRenderObjectWidget
{
ShaderMask
({
ShaderMask
({
Key
key
,
Key
key
,
this
.
shaderCallback
,
this
.
shaderCallback
,
...
@@ -112,7 +112,7 @@ class ShaderMask extends OneChildRenderObjectWidget {
...
@@ -112,7 +112,7 @@ class ShaderMask extends OneChildRenderObjectWidget {
/// Container insets its child by the widths of the borders, this Widget does not.
/// Container insets its child by the widths of the borders, this Widget does not.
///
///
/// Commonly used with [BoxDecoration].
/// Commonly used with [BoxDecoration].
class
DecoratedBox
extends
On
eChildRenderObjectWidget
{
class
DecoratedBox
extends
Singl
eChildRenderObjectWidget
{
DecoratedBox
({
DecoratedBox
({
Key
key
,
Key
key
,
this
.
decoration
,
this
.
decoration
,
...
@@ -153,7 +153,7 @@ class DecoratedBox extends OneChildRenderObjectWidget {
...
@@ -153,7 +153,7 @@ class DecoratedBox extends OneChildRenderObjectWidget {
///
///
/// Because custom paint calls its painters during paint, you cannot dirty
/// Because custom paint calls its painters during paint, you cannot dirty
/// layout or paint information during the callback.
/// layout or paint information during the callback.
class
CustomPaint
extends
On
eChildRenderObjectWidget
{
class
CustomPaint
extends
Singl
eChildRenderObjectWidget
{
CustomPaint
({
Key
key
,
this
.
painter
,
this
.
foregroundPainter
,
Widget
child
})
CustomPaint
({
Key
key
,
this
.
painter
,
this
.
foregroundPainter
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -184,7 +184,7 @@ class CustomPaint extends OneChildRenderObjectWidget {
...
@@ -184,7 +184,7 @@ class CustomPaint extends OneChildRenderObjectWidget {
/// Clips its child using a rectangle.
/// Clips its child using a rectangle.
///
///
/// Prevents its child from painting outside its bounds.
/// Prevents its child from painting outside its bounds.
class
ClipRect
extends
On
eChildRenderObjectWidget
{
class
ClipRect
extends
Singl
eChildRenderObjectWidget
{
ClipRect
({
Key
key
,
this
.
clipper
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
ClipRect
({
Key
key
,
this
.
clipper
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
/// If non-null, determines which clip to use.
/// If non-null, determines which clip to use.
...
@@ -206,7 +206,7 @@ class ClipRect extends OneChildRenderObjectWidget {
...
@@ -206,7 +206,7 @@ class ClipRect extends OneChildRenderObjectWidget {
/// Creates a rounded rectangle from its layout dimensions and the given x and
/// Creates a rounded rectangle from its layout dimensions and the given x and
/// y radius values and prevents its child from painting outside that rounded
/// y radius values and prevents its child from painting outside that rounded
/// rectangle.
/// rectangle.
class
ClipRRect
extends
On
eChildRenderObjectWidget
{
class
ClipRRect
extends
Singl
eChildRenderObjectWidget
{
ClipRRect
({
Key
key
,
this
.
xRadius
,
this
.
yRadius
,
Widget
child
})
ClipRRect
({
Key
key
,
this
.
xRadius
,
this
.
yRadius
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -235,7 +235,7 @@ class ClipRRect extends OneChildRenderObjectWidget {
...
@@ -235,7 +235,7 @@ class ClipRRect extends OneChildRenderObjectWidget {
///
///
/// Inscribes an oval into its layout dimensions and prevents its child from
/// Inscribes an oval into its layout dimensions and prevents its child from
/// painting outside that oval.
/// painting outside that oval.
class
ClipOval
extends
On
eChildRenderObjectWidget
{
class
ClipOval
extends
Singl
eChildRenderObjectWidget
{
ClipOval
({
Key
key
,
this
.
clipper
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
ClipOval
({
Key
key
,
this
.
clipper
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
/// If non-null, determines which clip to use.
/// If non-null, determines which clip to use.
...
@@ -256,7 +256,7 @@ class ClipOval extends OneChildRenderObjectWidget {
...
@@ -256,7 +256,7 @@ class ClipOval extends OneChildRenderObjectWidget {
// POSITIONING AND SIZING NODES
// POSITIONING AND SIZING NODES
/// Applies a transformation before painting its child.
/// Applies a transformation before painting its child.
class
Transform
extends
On
eChildRenderObjectWidget
{
class
Transform
extends
Singl
eChildRenderObjectWidget
{
Transform
({
Key
key
,
this
.
transform
,
this
.
origin
,
this
.
alignment
,
this
.
transformHitTests
:
true
,
Widget
child
})
Transform
({
Key
key
,
this
.
transform
,
this
.
origin
,
this
.
alignment
,
this
.
transformHitTests
:
true
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
transform
!=
null
);
assert
(
transform
!=
null
);
...
@@ -299,7 +299,7 @@ class Transform extends OneChildRenderObjectWidget {
...
@@ -299,7 +299,7 @@ class Transform extends OneChildRenderObjectWidget {
/// Applies a translation expressed as a fraction of the box's size before
/// Applies a translation expressed as a fraction of the box's size before
/// painting its child.
/// painting its child.
class
FractionalTranslation
extends
On
eChildRenderObjectWidget
{
class
FractionalTranslation
extends
Singl
eChildRenderObjectWidget
{
FractionalTranslation
({
Key
key
,
this
.
translation
,
this
.
transformHitTests
:
true
,
Widget
child
})
FractionalTranslation
({
Key
key
,
this
.
translation
,
this
.
transformHitTests
:
true
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
translation
!=
null
);
assert
(
translation
!=
null
);
...
@@ -325,7 +325,7 @@ class FractionalTranslation extends OneChildRenderObjectWidget {
...
@@ -325,7 +325,7 @@ class FractionalTranslation extends OneChildRenderObjectWidget {
/// Unlike [Transform], which applies a transform just prior to painting,
/// Unlike [Transform], which applies a transform just prior to painting,
/// this object applies its rotation prior to layout, which means the entire
/// this object applies its rotation prior to layout, which means the entire
/// rotated box consumes only as much space as required by the rotated child.
/// rotated box consumes only as much space as required by the rotated child.
class
RotatedBox
extends
On
eChildRenderObjectWidget
{
class
RotatedBox
extends
Singl
eChildRenderObjectWidget
{
RotatedBox
({
Key
key
,
this
.
quarterTurns
,
Widget
child
})
RotatedBox
({
Key
key
,
this
.
quarterTurns
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
quarterTurns
!=
null
);
assert
(
quarterTurns
!=
null
);
...
@@ -347,7 +347,7 @@ class RotatedBox extends OneChildRenderObjectWidget {
...
@@ -347,7 +347,7 @@ class RotatedBox extends OneChildRenderObjectWidget {
/// constraints by the given padding, causing the child to layout at a smaller
/// constraints by the given padding, causing the child to layout at a smaller
/// size. Padding then sizes itself to its child's size, inflated by the
/// size. Padding then sizes itself to its child's size, inflated by the
/// padding, effectively creating empty space around the child.
/// padding, effectively creating empty space around the child.
class
Padding
extends
On
eChildRenderObjectWidget
{
class
Padding
extends
Singl
eChildRenderObjectWidget
{
Padding
({
Key
key
,
this
.
padding
,
Widget
child
})
Padding
({
Key
key
,
this
.
padding
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
padding
!=
null
);
assert
(
padding
!=
null
);
...
@@ -373,7 +373,7 @@ class Padding extends OneChildRenderObjectWidget {
...
@@ -373,7 +373,7 @@ class Padding extends OneChildRenderObjectWidget {
/// unconstrained, then in that direction it will be sized to fit the child's
/// unconstrained, then in that direction it will be sized to fit the child's
/// dimensions. Using widthFactor and heightFactor you can force this latter
/// dimensions. Using widthFactor and heightFactor you can force this latter
/// behavior in all cases.
/// behavior in all cases.
class
Align
extends
On
eChildRenderObjectWidget
{
class
Align
extends
Singl
eChildRenderObjectWidget
{
Align
({
Align
({
Key
key
,
Key
key
,
this
.
alignment
:
const
FractionalOffset
(
0.5
,
0.5
),
this
.
alignment
:
const
FractionalOffset
(
0.5
,
0.5
),
...
@@ -429,8 +429,8 @@ class Center extends Align {
...
@@ -429,8 +429,8 @@ class Center extends Align {
/// decide where to position the child. The delegate can also determine the size
/// decide where to position the child. The delegate can also determine the size
/// of the parent, but the size of the parent cannot depend on the size of the
/// of the parent, but the size of the parent cannot depend on the size of the
/// child.
/// child.
class
Custom
OneChildLayout
extends
On
eChildRenderObjectWidget
{
class
Custom
SingleChildLayout
extends
Singl
eChildRenderObjectWidget
{
Custom
On
eChildLayout
({
Custom
Singl
eChildLayout
({
Key
key
,
Key
key
,
this
.
delegate
,
this
.
delegate
,
Widget
child
Widget
child
...
@@ -438,11 +438,11 @@ class CustomOneChildLayout extends OneChildRenderObjectWidget {
...
@@ -438,11 +438,11 @@ class CustomOneChildLayout extends OneChildRenderObjectWidget {
assert
(
delegate
!=
null
);
assert
(
delegate
!=
null
);
}
}
final
On
eChildLayoutDelegate
delegate
;
final
Singl
eChildLayoutDelegate
delegate
;
RenderCustom
OneChildLayoutBox
createRenderObject
(
BuildContext
context
)
=>
new
RenderCustomOn
eChildLayoutBox
(
delegate:
delegate
);
RenderCustom
SingleChildLayoutBox
createRenderObject
(
BuildContext
context
)
=>
new
RenderCustomSingl
eChildLayoutBox
(
delegate:
delegate
);
void
updateRenderObject
(
BuildContext
context
,
RenderCustom
On
eChildLayoutBox
renderObject
)
{
void
updateRenderObject
(
BuildContext
context
,
RenderCustom
Singl
eChildLayoutBox
renderObject
)
{
renderObject
.
delegate
=
delegate
;
renderObject
.
delegate
=
delegate
;
}
}
}
}
...
@@ -511,7 +511,7 @@ class CustomMultiChildLayout extends MultiChildRenderObjectWidget {
...
@@ -511,7 +511,7 @@ class CustomMultiChildLayout extends MultiChildRenderObjectWidget {
///
///
/// Forces its child to have a specific width and/or height and sizes itself to
/// Forces its child to have a specific width and/or height and sizes itself to
/// match the size of its child.
/// match the size of its child.
class
SizedBox
extends
On
eChildRenderObjectWidget
{
class
SizedBox
extends
Singl
eChildRenderObjectWidget
{
SizedBox
({
Key
key
,
this
.
width
,
this
.
height
,
Widget
child
})
SizedBox
({
Key
key
,
this
.
width
,
this
.
height
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -547,7 +547,7 @@ class SizedBox extends OneChildRenderObjectWidget {
...
@@ -547,7 +547,7 @@ class SizedBox extends OneChildRenderObjectWidget {
/// For example, if you wanted [child] to have a minimum height of 50.0 logical
/// For example, if you wanted [child] to have a minimum height of 50.0 logical
/// pixels, you could use `const BoxConstraints(minHeight: 50.0)`` as the
/// pixels, you could use `const BoxConstraints(minHeight: 50.0)`` as the
/// [additionalConstraints].
/// [additionalConstraints].
class
ConstrainedBox
extends
On
eChildRenderObjectWidget
{
class
ConstrainedBox
extends
Singl
eChildRenderObjectWidget
{
ConstrainedBox
({
Key
key
,
this
.
constraints
,
Widget
child
})
ConstrainedBox
({
Key
key
,
this
.
constraints
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
constraints
!=
null
);
assert
(
constraints
!=
null
);
...
@@ -571,7 +571,7 @@ class ConstrainedBox extends OneChildRenderObjectWidget {
...
@@ -571,7 +571,7 @@ class ConstrainedBox extends OneChildRenderObjectWidget {
/// Sizes itself to a fraction of the total available space.
/// Sizes itself to a fraction of the total available space.
///
///
/// See [RenderFractionallySizedBox] for details.
/// See [RenderFractionallySizedBox] for details.
class
FractionallySizedBox
extends
On
eChildRenderObjectWidget
{
class
FractionallySizedBox
extends
Singl
eChildRenderObjectWidget
{
FractionallySizedBox
({
Key
key
,
this
.
width
,
this
.
height
,
Widget
child
})
FractionallySizedBox
({
Key
key
,
this
.
width
,
this
.
height
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -611,7 +611,7 @@ class FractionallySizedBox extends OneChildRenderObjectWidget {
...
@@ -611,7 +611,7 @@ class FractionallySizedBox extends OneChildRenderObjectWidget {
/// from its parent, possibly allowing the child to overflow the parent.
/// from its parent, possibly allowing the child to overflow the parent.
///
///
/// See [RenderOverflowBox] for details.
/// See [RenderOverflowBox] for details.
class
OverflowBox
extends
On
eChildRenderObjectWidget
{
class
OverflowBox
extends
Singl
eChildRenderObjectWidget
{
OverflowBox
({
OverflowBox
({
Key
key
,
Key
key
,
this
.
minWidth
,
this
.
minWidth
,
...
@@ -679,7 +679,7 @@ class OverflowBox extends OneChildRenderObjectWidget {
...
@@ -679,7 +679,7 @@ class OverflowBox extends OneChildRenderObjectWidget {
}
}
}
}
class
SizedOverflowBox
extends
On
eChildRenderObjectWidget
{
class
SizedOverflowBox
extends
Singl
eChildRenderObjectWidget
{
SizedOverflowBox
({
Key
key
,
this
.
size
,
Widget
child
})
SizedOverflowBox
({
Key
key
,
this
.
size
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -695,7 +695,7 @@ class SizedOverflowBox extends OneChildRenderObjectWidget {
...
@@ -695,7 +695,7 @@ class SizedOverflowBox extends OneChildRenderObjectWidget {
/// Lays the child out as if it was in the tree, but without painting anything,
/// Lays the child out as if it was in the tree, but without painting anything,
/// without making the child available for hit testing, and without taking any
/// without making the child available for hit testing, and without taking any
/// room in the parent.
/// room in the parent.
class
OffStage
extends
On
eChildRenderObjectWidget
{
class
OffStage
extends
Singl
eChildRenderObjectWidget
{
OffStage
({
Key
key
,
Widget
child
})
OffStage
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -728,7 +728,7 @@ class OffStage extends OneChildRenderObjectWidget {
...
@@ -728,7 +728,7 @@ class OffStage extends OneChildRenderObjectWidget {
/// find a feasible size after consulting each constraint, the widget
/// find a feasible size after consulting each constraint, the widget
/// will eventually select a size for the child that meets the layout
/// will eventually select a size for the child that meets the layout
/// constraints but fails to meet the aspect ratio constraints.
/// constraints but fails to meet the aspect ratio constraints.
class
AspectRatio
extends
On
eChildRenderObjectWidget
{
class
AspectRatio
extends
Singl
eChildRenderObjectWidget
{
AspectRatio
({
Key
key
,
this
.
aspectRatio
,
Widget
child
})
AspectRatio
({
Key
key
,
this
.
aspectRatio
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
aspectRatio
!=
null
);
assert
(
aspectRatio
!=
null
);
...
@@ -764,7 +764,7 @@ class AspectRatio extends OneChildRenderObjectWidget {
...
@@ -764,7 +764,7 @@ class AspectRatio extends OneChildRenderObjectWidget {
/// instead size itself to a more reasonable width.
/// instead size itself to a more reasonable width.
///
///
/// This class is relatively expensive. Avoid using it where possible.
/// This class is relatively expensive. Avoid using it where possible.
class
IntrinsicWidth
extends
On
eChildRenderObjectWidget
{
class
IntrinsicWidth
extends
Singl
eChildRenderObjectWidget
{
IntrinsicWidth
({
Key
key
,
this
.
stepWidth
,
this
.
stepHeight
,
Widget
child
})
IntrinsicWidth
({
Key
key
,
this
.
stepWidth
,
this
.
stepHeight
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -790,13 +790,13 @@ class IntrinsicWidth extends OneChildRenderObjectWidget {
...
@@ -790,13 +790,13 @@ class IntrinsicWidth extends OneChildRenderObjectWidget {
/// instead size itself to a more reasonable height.
/// instead size itself to a more reasonable height.
///
///
/// This class is relatively expensive. Avoid using it where possible.
/// This class is relatively expensive. Avoid using it where possible.
class
IntrinsicHeight
extends
On
eChildRenderObjectWidget
{
class
IntrinsicHeight
extends
Singl
eChildRenderObjectWidget
{
IntrinsicHeight
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
IntrinsicHeight
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderIntrinsicHeight
createRenderObject
(
BuildContext
context
)
=>
new
RenderIntrinsicHeight
();
RenderIntrinsicHeight
createRenderObject
(
BuildContext
context
)
=>
new
RenderIntrinsicHeight
();
}
}
/// Positions its child vertically according to the child's baseline.
/// Positions its child vertically according to the child's baseline.
class
Baseline
extends
On
eChildRenderObjectWidget
{
class
Baseline
extends
Singl
eChildRenderObjectWidget
{
Baseline
({
Key
key
,
this
.
baseline
,
this
.
baselineType
:
TextBaseline
.
alphabetic
,
Widget
child
})
Baseline
({
Key
key
,
this
.
baseline
,
this
.
baselineType
:
TextBaseline
.
alphabetic
,
Widget
child
})
:
super
(
key:
key
,
child:
child
)
{
:
super
(
key:
key
,
child:
child
)
{
assert
(
baseline
!=
null
);
assert
(
baseline
!=
null
);
...
@@ -828,7 +828,7 @@ class Baseline extends OneChildRenderObjectWidget {
...
@@ -828,7 +828,7 @@ class Baseline extends OneChildRenderObjectWidget {
///
///
/// Viewport is the core scrolling primitive in the system, but it can be used
/// Viewport is the core scrolling primitive in the system, but it can be used
/// in other situations.
/// in other situations.
class
Viewport
extends
On
eChildRenderObjectWidget
{
class
Viewport
extends
Singl
eChildRenderObjectWidget
{
Viewport
({
Viewport
({
Key
key
,
Key
key
,
this
.
paintOffset
:
Offset
.
zero
,
this
.
paintOffset
:
Offset
.
zero
,
...
@@ -2133,7 +2133,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget {
...
@@ -2133,7 +2133,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget {
// EVENT HANDLING
// EVENT HANDLING
class
Listener
extends
On
eChildRenderObjectWidget
{
class
Listener
extends
Singl
eChildRenderObjectWidget
{
Listener
({
Listener
({
Key
key
,
Key
key
,
Widget
child
,
Widget
child
,
...
@@ -2206,12 +2206,12 @@ class Listener extends OneChildRenderObjectWidget {
...
@@ -2206,12 +2206,12 @@ class Listener extends OneChildRenderObjectWidget {
/// previously. Similarly, when the child repaints but the surround tree does
/// previously. Similarly, when the child repaints but the surround tree does
/// not, we can re-record its display list without re-recording the display list
/// not, we can re-record its display list without re-recording the display list
/// for the surround tree.
/// for the surround tree.
class
RepaintBoundary
extends
On
eChildRenderObjectWidget
{
class
RepaintBoundary
extends
Singl
eChildRenderObjectWidget
{
RepaintBoundary
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RepaintBoundary
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderRepaintBoundary
createRenderObject
(
BuildContext
context
)
=>
new
RenderRepaintBoundary
();
RenderRepaintBoundary
createRenderObject
(
BuildContext
context
)
=>
new
RenderRepaintBoundary
();
}
}
class
IgnorePointer
extends
On
eChildRenderObjectWidget
{
class
IgnorePointer
extends
Singl
eChildRenderObjectWidget
{
IgnorePointer
({
Key
key
,
Widget
child
,
this
.
ignoring
:
true
,
this
.
ignoringSemantics
})
IgnorePointer
({
Key
key
,
Widget
child
,
this
.
ignoring
:
true
,
this
.
ignoringSemantics
})
:
super
(
key:
key
,
child:
child
);
:
super
(
key:
key
,
child:
child
);
...
@@ -2237,7 +2237,7 @@ class IgnorePointer extends OneChildRenderObjectWidget {
...
@@ -2237,7 +2237,7 @@ class IgnorePointer extends OneChildRenderObjectWidget {
/// of the meaning of the widgets, so that accessibility tools, search
/// of the meaning of the widgets, so that accessibility tools, search
/// engines, and other semantic analysis software can determine the
/// engines, and other semantic analysis software can determine the
/// meaning of the application.
/// meaning of the application.
class
Semantics
extends
On
eChildRenderObjectWidget
{
class
Semantics
extends
Singl
eChildRenderObjectWidget
{
Semantics
({
Semantics
({
Key
key
,
Key
key
,
Widget
child
,
Widget
child
,
...
@@ -2308,7 +2308,7 @@ class Semantics extends OneChildRenderObjectWidget {
...
@@ -2308,7 +2308,7 @@ class Semantics extends OneChildRenderObjectWidget {
/// multiple nodes in the merged subtree can handle semantic gestures,
/// multiple nodes in the merged subtree can handle semantic gestures,
/// the first one in tree order will be the one to receive the
/// the first one in tree order will be the one to receive the
/// callbacks.
/// callbacks.
class
MergeSemantics
extends
On
eChildRenderObjectWidget
{
class
MergeSemantics
extends
Singl
eChildRenderObjectWidget
{
MergeSemantics
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
MergeSemantics
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderMergeSemantics
createRenderObject
(
BuildContext
context
)
=>
new
RenderMergeSemantics
();
RenderMergeSemantics
createRenderObject
(
BuildContext
context
)
=>
new
RenderMergeSemantics
();
}
}
...
@@ -2319,12 +2319,12 @@ class MergeSemantics extends OneChildRenderObjectWidget {
...
@@ -2319,12 +2319,12 @@ class MergeSemantics extends OneChildRenderObjectWidget {
/// reported but that would only be confusing. For example, the
/// reported but that would only be confusing. For example, the
/// material library's [Chip] widget hides the avatar since it is
/// material library's [Chip] widget hides the avatar since it is
/// redundant with the chip label.
/// redundant with the chip label.
class
ExcludeSemantics
extends
On
eChildRenderObjectWidget
{
class
ExcludeSemantics
extends
Singl
eChildRenderObjectWidget
{
ExcludeSemantics
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
ExcludeSemantics
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderExcludeSemantics
createRenderObject
(
BuildContext
context
)
=>
new
RenderExcludeSemantics
();
RenderExcludeSemantics
createRenderObject
(
BuildContext
context
)
=>
new
RenderExcludeSemantics
();
}
}
class
MetaData
extends
On
eChildRenderObjectWidget
{
class
MetaData
extends
Singl
eChildRenderObjectWidget
{
MetaData
({
MetaData
({
Key
key
,
Key
key
,
Widget
child
,
Widget
child
,
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
726eff49
...
@@ -506,12 +506,12 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget {
...
@@ -506,12 +506,12 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget {
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have a single child slot. (This superclass only provides the storage
/// that have a single child slot. (This superclass only provides the storage
/// for that child, it doesn't actually provide the updating logic.)
/// for that child, it doesn't actually provide the updating logic.)
abstract
class
On
eChildRenderObjectWidget
extends
RenderObjectWidget
{
abstract
class
Singl
eChildRenderObjectWidget
extends
RenderObjectWidget
{
const
On
eChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
const
Singl
eChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
final
Widget
child
;
OneChildRenderObjectElement
createElement
()
=>
new
On
eChildRenderObjectElement
(
this
);
SingleChildRenderObjectElement
createElement
()
=>
new
Singl
eChildRenderObjectElement
(
this
);
}
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
...
@@ -1772,10 +1772,10 @@ class LeafRenderObjectElement extends RenderObjectElement {
...
@@ -1772,10 +1772,10 @@ class LeafRenderObjectElement extends RenderObjectElement {
}
}
/// Instantiation of RenderObjectWidgets that have up to one child
/// Instantiation of RenderObjectWidgets that have up to one child
class
On
eChildRenderObjectElement
extends
RenderObjectElement
{
class
Singl
eChildRenderObjectElement
extends
RenderObjectElement
{
OneChildRenderObjectElement
(
On
eChildRenderObjectWidget
widget
)
:
super
(
widget
);
SingleChildRenderObjectElement
(
Singl
eChildRenderObjectWidget
widget
)
:
super
(
widget
);
On
eChildRenderObjectWidget
get
widget
=>
super
.
widget
;
Singl
eChildRenderObjectWidget
get
widget
=>
super
.
widget
;
Element
_child
;
Element
_child
;
...
@@ -1796,7 +1796,7 @@ class OneChildRenderObjectElement extends RenderObjectElement {
...
@@ -1796,7 +1796,7 @@ class OneChildRenderObjectElement extends RenderObjectElement {
_child
=
updateChild
(
_child
,
widget
.
child
,
null
);
_child
=
updateChild
(
_child
,
widget
.
child
,
null
);
}
}
void
update
(
On
eChildRenderObjectWidget
newWidget
)
{
void
update
(
Singl
eChildRenderObjectWidget
newWidget
)
{
super
.
update
(
newWidget
);
super
.
update
(
newWidget
);
assert
(
widget
==
newWidget
);
assert
(
widget
==
newWidget
);
_child
=
updateChild
(
_child
,
widget
.
child
,
null
);
_child
=
updateChild
(
_child
,
widget
.
child
,
null
);
...
...
packages/flutter/lib/src/widgets/gesture_detector.dart
View file @
726eff49
...
@@ -375,7 +375,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
...
@@ -375,7 +375,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
}
}
}
}
class
_GestureSemantics
extends
On
eChildRenderObjectWidget
{
class
_GestureSemantics
extends
Singl
eChildRenderObjectWidget
{
_GestureSemantics
({
_GestureSemantics
({
Key
key
,
Key
key
,
Widget
child
,
Widget
child
,
...
...
packages/flutter/test/widget/custom_one_child_layout_test.dart
View file @
726eff49
...
@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart';
...
@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart';
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:test/test.dart'
;
import
'package:test/test.dart'
;
class
Test
OneChildLayoutDelegate
extends
On
eChildLayoutDelegate
{
class
Test
SingleChildLayoutDelegate
extends
Singl
eChildLayoutDelegate
{
BoxConstraints
constraintsFromGetSize
;
BoxConstraints
constraintsFromGetSize
;
BoxConstraints
constraintsFromGetConstraintsForChild
;
BoxConstraints
constraintsFromGetConstraintsForChild
;
Size
sizeFromGetPositionForChild
;
Size
sizeFromGetPositionForChild
;
...
@@ -46,14 +46,14 @@ class TestOneChildLayoutDelegate extends OneChildLayoutDelegate {
...
@@ -46,14 +46,14 @@ class TestOneChildLayoutDelegate extends OneChildLayoutDelegate {
}
}
}
}
Widget
buildFrame
(
On
eChildLayoutDelegate
delegate
)
{
Widget
buildFrame
(
Singl
eChildLayoutDelegate
delegate
)
{
return
new
Center
(
child:
new
Custom
On
eChildLayout
(
delegate:
delegate
,
child:
new
Container
()));
return
new
Center
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
delegate
,
child:
new
Container
()));
}
}
void
main
(
)
{
void
main
(
)
{
test
(
'Control test for Custom
On
eChildLayout'
,
()
{
test
(
'Control test for Custom
Singl
eChildLayout'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
testWidgets
((
WidgetTester
tester
)
{
Test
OneChildLayoutDelegate
delegate
=
new
TestOn
eChildLayoutDelegate
();
Test
SingleChildLayoutDelegate
delegate
=
new
TestSingl
eChildLayoutDelegate
();
tester
.
pumpWidget
(
buildFrame
(
delegate
));
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
constraintsFromGetSize
.
minWidth
,
0.0
);
expect
(
delegate
.
constraintsFromGetSize
.
minWidth
,
0.0
);
...
@@ -74,9 +74,9 @@ void main() {
...
@@ -74,9 +74,9 @@ void main() {
});
});
});
});
test
(
'Test
On
eChildDelegate shouldRelayout method'
,
()
{
test
(
'Test
Singl
eChildDelegate shouldRelayout method'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
testWidgets
((
WidgetTester
tester
)
{
Test
OneChildLayoutDelegate
delegate
=
new
TestOn
eChildLayoutDelegate
();
Test
SingleChildLayoutDelegate
delegate
=
new
TestSingl
eChildLayoutDelegate
();
tester
.
pumpWidget
(
buildFrame
(
delegate
));
tester
.
pumpWidget
(
buildFrame
(
delegate
));
// Layout happened because the delegate was set.
// Layout happened because the delegate was set.
...
@@ -84,14 +84,14 @@ void main() {
...
@@ -84,14 +84,14 @@ void main() {
expect
(
delegate
.
shouldRelayoutCalled
,
isFalse
);
expect
(
delegate
.
shouldRelayoutCalled
,
isFalse
);
// Layout did not happen because shouldRelayout() returned false.
// Layout did not happen because shouldRelayout() returned false.
delegate
=
new
Test
On
eChildLayoutDelegate
();
delegate
=
new
Test
Singl
eChildLayoutDelegate
();
delegate
.
shouldRelayoutValue
=
false
;
delegate
.
shouldRelayoutValue
=
false
;
tester
.
pumpWidget
(
buildFrame
(
delegate
));
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
expect
(
delegate
.
constraintsFromGetConstraintsForChild
,
isNull
);
expect
(
delegate
.
constraintsFromGetConstraintsForChild
,
isNull
);
// Layout happened because shouldRelayout() returned true.
// Layout happened because shouldRelayout() returned true.
delegate
=
new
Test
On
eChildLayoutDelegate
();
delegate
=
new
Test
Singl
eChildLayoutDelegate
();
delegate
.
shouldRelayoutValue
=
true
;
delegate
.
shouldRelayoutValue
=
true
;
tester
.
pumpWidget
(
buildFrame
(
delegate
));
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
...
...
packages/flutter/test/widget/render_object_widget_test.dart
View file @
726eff49
...
@@ -21,8 +21,8 @@ void main() {
...
@@ -21,8 +21,8 @@ void main() {
test
(
'RenderObjectWidget smoke test'
,
()
{
test
(
'RenderObjectWidget smoke test'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
testWidgets
((
WidgetTester
tester
)
{
tester
.
pumpWidget
(
new
DecoratedBox
(
decoration:
kBoxDecorationA
));
tester
.
pumpWidget
(
new
DecoratedBox
(
decoration:
kBoxDecorationA
));
On
eChildRenderObjectElement
element
=
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
@@ -30,7 +30,7 @@ void main() {
...
@@ -30,7 +30,7 @@ void main() {
expect
(
renderObject
.
position
,
equals
(
DecorationPosition
.
background
));
expect
(
renderObject
.
position
,
equals
(
DecorationPosition
.
background
));
tester
.
pumpWidget
(
new
DecoratedBox
(
decoration:
kBoxDecorationB
));
tester
.
pumpWidget
(
new
DecoratedBox
(
decoration:
kBoxDecorationB
));
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
renderObject
=
element
.
renderObject
;
renderObject
=
element
.
renderObject
;
...
@@ -43,8 +43,8 @@ void main() {
...
@@ -43,8 +43,8 @@ void main() {
testWidgets
((
WidgetTester
tester
)
{
testWidgets
((
WidgetTester
tester
)
{
void
checkFullTree
()
{
void
checkFullTree
()
{
On
eChildRenderObjectElement
element
=
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
@@ -59,8 +59,8 @@ void main() {
...
@@ -59,8 +59,8 @@ void main() {
}
}
void
childBareTree
()
{
void
childBareTree
()
{
On
eChildRenderObjectElement
element
=
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
@@ -138,8 +138,8 @@ void main() {
...
@@ -138,8 +138,8 @@ void main() {
)
)
));
));
On
eChildRenderObjectElement
element
=
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
parent
=
element
.
renderObject
;
RenderDecoratedBox
parent
=
element
.
renderObject
;
expect
(
parent
.
child
is
RenderDecoratedBox
,
isTrue
);
expect
(
parent
.
child
is
RenderDecoratedBox
,
isTrue
);
...
@@ -155,7 +155,7 @@ void main() {
...
@@ -155,7 +155,7 @@ void main() {
));
));
element
=
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
,
equals
(
parent
));
expect
(
element
.
renderObject
,
equals
(
parent
));
expect
(
parent
.
child
,
isNull
);
expect
(
parent
.
child
,
isNull
);
...
...
packages/flutter/test/widget/stateful_component_test.dart
View file @
726eff49
...
@@ -14,8 +14,8 @@ void main() {
...
@@ -14,8 +14,8 @@ void main() {
testWidgets
((
WidgetTester
tester
)
{
testWidgets
((
WidgetTester
tester
)
{
void
checkTree
(
BoxDecoration
expectedDecoration
)
{
void
checkTree
(
BoxDecoration
expectedDecoration
)
{
On
eChildRenderObjectElement
element
=
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
...
packages/flutter_sprites/lib/src/sprite_widget.dart
View file @
726eff49
part of
flutter_sprites
;
part of
flutter_sprites
;
/// A widget that uses a [SpriteBox] to render a sprite node tree to the screen.
/// A widget that uses a [SpriteBox] to render a sprite node tree to the screen.
class
SpriteWidget
extends
On
eChildRenderObjectWidget
{
class
SpriteWidget
extends
Singl
eChildRenderObjectWidget
{
/// The rootNode of the sprite node tree.
/// The rootNode of the sprite node tree.
///
///
...
...
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