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
a10b1836
Commit
a10b1836
authored
Jan 19, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1298 from Hixie/move-render-object-widgets-down
Move RenderObjectWidgets down
parents
1770004e
03dcd268
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
59 deletions
+57
-59
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+57
-59
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
a10b1836
...
...
@@ -237,65 +237,6 @@ abstract class Widget {
}
}
// TODO(ianh): move the next four classes to below InheritedWidget
/// RenderObjectWidgets provide the configuration for [RenderObjectElement]s,
/// which wrap [RenderObject]s, which provide the actual rendering of the
/// application.
abstract
class
RenderObjectWidget
extends
Widget
{
const
RenderObjectWidget
({
Key
key
})
:
super
(
key:
key
);
/// RenderObjectWidgets always inflate to a RenderObjectElement subclass.
RenderObjectElement
createElement
();
/// Constructs an instance of the RenderObject class that this
/// RenderObjectWidget represents, using the configuration described by this
/// RenderObjectWidget.
RenderObject
createRenderObject
();
/// Copies the configuration described by this RenderObjectWidget to the given
/// RenderObject, which must be of the same type as returned by this class'
/// createRenderObject().
void
updateRenderObject
(
RenderObject
renderObject
,
RenderObjectWidget
oldWidget
)
{
}
void
didUnmountRenderObject
(
RenderObject
renderObject
)
{
}
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have no children.
abstract
class
LeafRenderObjectWidget
extends
RenderObjectWidget
{
const
LeafRenderObjectWidget
({
Key
key
})
:
super
(
key:
key
);
LeafRenderObjectElement
createElement
()
=>
new
LeafRenderObjectElement
(
this
);
}
/// 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
OneChildRenderObjectWidget
extends
RenderObjectWidget
{
const
OneChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
OneChildRenderObjectElement
createElement
()
=>
new
OneChildRenderObjectElement
(
this
);
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have a single list of children. (This superclass only provides the
/// storage for that child list, it doesn't actually provide the updating
/// logic.)
abstract
class
MultiChildRenderObjectWidget
extends
RenderObjectWidget
{
MultiChildRenderObjectWidget
({
Key
key
,
this
.
children
})
:
super
(
key:
key
)
{
assert
(
children
!=
null
);
assert
(!
children
.
any
((
Widget
child
)
=>
child
==
null
));
}
final
List
<
Widget
>
children
;
MultiChildRenderObjectElement
createElement
()
=>
new
MultiChildRenderObjectElement
(
this
);
}
/// StatelessComponents describe a way to compose other Widgets to form reusable
/// parts, which doesn't depend on anything other than the configuration
/// information in the object itself. (For compositions that can change
...
...
@@ -514,6 +455,63 @@ abstract class InheritedWidget extends _ProxyComponent {
bool
updateShouldNotify
(
InheritedWidget
oldWidget
);
}
/// RenderObjectWidgets provide the configuration for [RenderObjectElement]s,
/// which wrap [RenderObject]s, which provide the actual rendering of the
/// application.
abstract
class
RenderObjectWidget
extends
Widget
{
const
RenderObjectWidget
({
Key
key
})
:
super
(
key:
key
);
/// RenderObjectWidgets always inflate to a RenderObjectElement subclass.
RenderObjectElement
createElement
();
/// Constructs an instance of the RenderObject class that this
/// RenderObjectWidget represents, using the configuration described by this
/// RenderObjectWidget.
RenderObject
createRenderObject
();
/// Copies the configuration described by this RenderObjectWidget to the given
/// RenderObject, which must be of the same type as returned by this class'
/// createRenderObject().
void
updateRenderObject
(
RenderObject
renderObject
,
RenderObjectWidget
oldWidget
)
{
}
void
didUnmountRenderObject
(
RenderObject
renderObject
)
{
}
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have no children.
abstract
class
LeafRenderObjectWidget
extends
RenderObjectWidget
{
const
LeafRenderObjectWidget
({
Key
key
})
:
super
(
key:
key
);
LeafRenderObjectElement
createElement
()
=>
new
LeafRenderObjectElement
(
this
);
}
/// 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
OneChildRenderObjectWidget
extends
RenderObjectWidget
{
const
OneChildRenderObjectWidget
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
OneChildRenderObjectElement
createElement
()
=>
new
OneChildRenderObjectElement
(
this
);
}
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses
/// that have a single list of children. (This superclass only provides the
/// storage for that child list, it doesn't actually provide the updating
/// logic.)
abstract
class
MultiChildRenderObjectWidget
extends
RenderObjectWidget
{
MultiChildRenderObjectWidget
({
Key
key
,
this
.
children
})
:
super
(
key:
key
)
{
assert
(
children
!=
null
);
assert
(!
children
.
any
((
Widget
child
)
=>
child
==
null
));
}
final
List
<
Widget
>
children
;
MultiChildRenderObjectElement
createElement
()
=>
new
MultiChildRenderObjectElement
(
this
);
}
// ELEMENTS
...
...
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