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
Expand all
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 {
}
}
class
Dots
extends
On
eChildRenderObjectWidget
{
class
Dots
extends
Singl
eChildRenderObjectWidget
{
Dots
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
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> {
// MODAL BOTTOM SHEETS
class
_ModalBottomSheetLayout
extends
On
eChildLayoutDelegate
{
class
_ModalBottomSheetLayout
extends
Singl
eChildLayoutDelegate
{
_ModalBottomSheetLayout
(
this
.
progress
);
final
double
progress
;
...
...
@@ -133,7 +133,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
animation:
config
.
route
.
animation
,
builder:
(
BuildContext
context
,
Widget
child
)
{
return
new
ClipRect
(
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_ModalBottomSheetLayout
(
config
.
route
.
animation
.
value
),
child:
new
BottomSheet
(
animationController:
config
.
route
.
animation
,
...
...
packages/flutter/lib/src/material/material.dart
View file @
726eff49
...
...
@@ -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
);
final
Color
color
;
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
726eff49
...
...
@@ -233,7 +233,7 @@ class _PopupMenu<T> extends StatelessComponent {
}
}
class
_PopupMenuRouteLayout
extends
On
eChildLayoutDelegate
{
class
_PopupMenuRouteLayout
extends
Singl
eChildLayoutDelegate
{
_PopupMenuRouteLayout
(
this
.
position
,
this
.
selectedItemOffset
);
final
ModalPosition
position
;
...
...
@@ -316,7 +316,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
final
Size
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
maxWidth:
screenSize
.
width
,
maxHeight:
screenSize
.
height
),
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_PopupMenuRouteLayout
(
position
,
selectedItemOffset
),
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> {
}
}
class
_TooltipPositionDelegate
extends
On
eChildLayoutDelegate
{
class
_TooltipPositionDelegate
extends
Singl
eChildLayoutDelegate
{
_TooltipPositionDelegate
({
this
.
target
,
this
.
verticalOffset
,
...
...
@@ -271,7 +271,7 @@ class _TooltipOverlay extends StatelessComponent {
right:
0.0
,
bottom:
0.0
,
child:
new
IgnorePointer
(
child:
new
Custom
On
eChildLayout
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
new
_TooltipPositionDelegate
(
target:
target
,
verticalOffset:
verticalOffset
,
...
...
packages/flutter/lib/src/rendering/custom_layout.dart
View file @
726eff49
...
...
@@ -5,7 +5,7 @@
import
'box.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].
class
MultiChildLayoutParentData
extends
ContainerBoxParentDataMixin
<
RenderBox
>
{
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
726eff49
...
...
@@ -506,7 +506,7 @@ class RenderOverflowBox extends RenderShiftedBox {
}
/// 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.
Size
getSize
(
BoxConstraints
constraints
)
=>
constraints
.
biggest
;
...
...
@@ -517,7 +517,7 @@ class OneChildLayoutDelegate {
Offset
getPositionForChild
(
Size
size
,
Size
childSize
)
=>
Offset
.
zero
;
/// 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.
...
...
@@ -526,18 +526,18 @@ class OneChildLayoutDelegate {
/// 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
/// child.
class
RenderCustom
On
eChildLayoutBox
extends
RenderShiftedBox
{
RenderCustom
On
eChildLayoutBox
({
class
RenderCustom
Singl
eChildLayoutBox
extends
RenderShiftedBox
{
RenderCustom
Singl
eChildLayoutBox
({
RenderBox
child
,
On
eChildLayoutDelegate
delegate
Singl
eChildLayoutDelegate
delegate
})
:
_delegate
=
delegate
,
super
(
child
)
{
assert
(
delegate
!=
null
);
}
/// A delegate that controls this object's layout.
On
eChildLayoutDelegate
get
delegate
=>
_delegate
;
On
eChildLayoutDelegate
_delegate
;
void
set
delegate
(
On
eChildLayoutDelegate
newDelegate
)
{
Singl
eChildLayoutDelegate
get
delegate
=>
_delegate
;
Singl
eChildLayoutDelegate
_delegate
;
void
set
delegate
(
Singl
eChildLayoutDelegate
newDelegate
)
{
assert
(
newDelegate
!=
null
);
if
(
_delegate
==
newDelegate
)
return
;
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
726eff49
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/framework.dart
View file @
726eff49
...
...
@@ -506,12 +506,12 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget {
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have a single child slot. (This superclass only provides the storage
/// for that child, it doesn't actually provide the updating logic.)
abstract
class
On
eChildRenderObjectWidget
extends
RenderObjectWidget
{
const
On
eChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
abstract
class
Singl
eChildRenderObjectWidget
extends
RenderObjectWidget
{
const
Singl
eChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
OneChildRenderObjectElement
createElement
()
=>
new
On
eChildRenderObjectElement
(
this
);
SingleChildRenderObjectElement
createElement
()
=>
new
Singl
eChildRenderObjectElement
(
this
);
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
...
...
@@ -1772,10 +1772,10 @@ class LeafRenderObjectElement extends RenderObjectElement {
}
/// Instantiation of RenderObjectWidgets that have up to one child
class
On
eChildRenderObjectElement
extends
RenderObjectElement
{
OneChildRenderObjectElement
(
On
eChildRenderObjectWidget
widget
)
:
super
(
widget
);
class
Singl
eChildRenderObjectElement
extends
RenderObjectElement
{
SingleChildRenderObjectElement
(
Singl
eChildRenderObjectWidget
widget
)
:
super
(
widget
);
On
eChildRenderObjectWidget
get
widget
=>
super
.
widget
;
Singl
eChildRenderObjectWidget
get
widget
=>
super
.
widget
;
Element
_child
;
...
...
@@ -1796,7 +1796,7 @@ class OneChildRenderObjectElement extends RenderObjectElement {
_child
=
updateChild
(
_child
,
widget
.
child
,
null
);
}
void
update
(
On
eChildRenderObjectWidget
newWidget
)
{
void
update
(
Singl
eChildRenderObjectWidget
newWidget
)
{
super
.
update
(
newWidget
);
assert
(
widget
==
newWidget
);
_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> {
}
}
class
_GestureSemantics
extends
On
eChildRenderObjectWidget
{
class
_GestureSemantics
extends
Singl
eChildRenderObjectWidget
{
_GestureSemantics
({
Key
key
,
Widget
child
,
...
...
packages/flutter/test/widget/custom_one_child_layout_test.dart
View file @
726eff49
...
...
@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart';
import
'package:flutter/widgets.dart'
;
import
'package:test/test.dart'
;
class
Test
OneChildLayoutDelegate
extends
On
eChildLayoutDelegate
{
class
Test
SingleChildLayoutDelegate
extends
Singl
eChildLayoutDelegate
{
BoxConstraints
constraintsFromGetSize
;
BoxConstraints
constraintsFromGetConstraintsForChild
;
Size
sizeFromGetPositionForChild
;
...
...
@@ -46,14 +46,14 @@ class TestOneChildLayoutDelegate extends OneChildLayoutDelegate {
}
}
Widget
buildFrame
(
On
eChildLayoutDelegate
delegate
)
{
return
new
Center
(
child:
new
Custom
On
eChildLayout
(
delegate:
delegate
,
child:
new
Container
()));
Widget
buildFrame
(
Singl
eChildLayoutDelegate
delegate
)
{
return
new
Center
(
child:
new
Custom
Singl
eChildLayout
(
delegate:
delegate
,
child:
new
Container
()));
}
void
main
(
)
{
test
(
'Control test for Custom
On
eChildLayout'
,
()
{
test
(
'Control test for Custom
Singl
eChildLayout'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
Test
OneChildLayoutDelegate
delegate
=
new
TestOn
eChildLayoutDelegate
();
Test
SingleChildLayoutDelegate
delegate
=
new
TestSingl
eChildLayoutDelegate
();
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
constraintsFromGetSize
.
minWidth
,
0.0
);
...
...
@@ -74,9 +74,9 @@ void main() {
});
});
test
(
'Test
On
eChildDelegate shouldRelayout method'
,
()
{
test
(
'Test
Singl
eChildDelegate shouldRelayout method'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
Test
OneChildLayoutDelegate
delegate
=
new
TestOn
eChildLayoutDelegate
();
Test
SingleChildLayoutDelegate
delegate
=
new
TestSingl
eChildLayoutDelegate
();
tester
.
pumpWidget
(
buildFrame
(
delegate
));
// Layout happened because the delegate was set.
...
...
@@ -84,14 +84,14 @@ void main() {
expect
(
delegate
.
shouldRelayoutCalled
,
isFalse
);
// Layout did not happen because shouldRelayout() returned false.
delegate
=
new
Test
On
eChildLayoutDelegate
();
delegate
=
new
Test
Singl
eChildLayoutDelegate
();
delegate
.
shouldRelayoutValue
=
false
;
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
expect
(
delegate
.
constraintsFromGetConstraintsForChild
,
isNull
);
// Layout happened because shouldRelayout() returned true.
delegate
=
new
Test
On
eChildLayoutDelegate
();
delegate
=
new
Test
Singl
eChildLayoutDelegate
();
delegate
.
shouldRelayoutValue
=
true
;
tester
.
pumpWidget
(
buildFrame
(
delegate
));
expect
(
delegate
.
shouldRelayoutCalled
,
isTrue
);
...
...
packages/flutter/test/widget/render_object_widget_test.dart
View file @
726eff49
...
...
@@ -21,8 +21,8 @@ void main() {
test
(
'RenderObjectWidget smoke test'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
tester
.
pumpWidget
(
new
DecoratedBox
(
decoration:
kBoxDecorationA
));
On
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
...
@@ -30,7 +30,7 @@ void main() {
expect
(
renderObject
.
position
,
equals
(
DecorationPosition
.
background
));
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
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
renderObject
=
element
.
renderObject
;
...
...
@@ -43,8 +43,8 @@ void main() {
testWidgets
((
WidgetTester
tester
)
{
void
checkFullTree
()
{
On
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
...
@@ -59,8 +59,8 @@ void main() {
}
void
childBareTree
()
{
On
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
...
@@ -138,8 +138,8 @@ void main() {
)
));
On
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
parent
=
element
.
renderObject
;
expect
(
parent
.
child
is
RenderDecoratedBox
,
isTrue
);
...
...
@@ -155,7 +155,7 @@ void main() {
));
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
,
equals
(
parent
));
expect
(
parent
.
child
,
isNull
);
...
...
packages/flutter/test/widget/stateful_component_test.dart
View file @
726eff49
...
...
@@ -14,8 +14,8 @@ void main() {
testWidgets
((
WidgetTester
tester
)
{
void
checkTree
(
BoxDecoration
expectedDecoration
)
{
On
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
On
eChildRenderObjectElement
);
Singl
eChildRenderObjectElement
element
=
tester
.
findElement
((
Element
element
)
=>
element
is
Singl
eChildRenderObjectElement
);
expect
(
element
,
isNotNull
);
expect
(
element
.
renderObject
is
RenderDecoratedBox
,
isTrue
);
RenderDecoratedBox
renderObject
=
element
.
renderObject
;
...
...
packages/flutter_sprites/lib/src/sprite_widget.dart
View file @
726eff49
part of
flutter_sprites
;
/// 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.
///
...
...
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