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
c51fba97
Unverified
Commit
c51fba97
authored
Feb 18, 2021
by
creativecreatorormaybenot
Committed by
GitHub
Feb 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve lifecycle docs (#76021)
parent
ba58ad03
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
16 deletions
+34
-16
node.dart
packages/flutter/lib/src/foundation/node.dart
+6
-0
box.dart
packages/flutter/lib/src/rendering/box.dart
+2
-2
viewport_offset.dart
packages/flutter/lib/src/rendering/viewport_offset.dart
+2
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+20
-8
notification_listener.dart
packages/flutter/lib/src/widgets/notification_listener.dart
+2
-2
scroll_controller.dart
packages/flutter/lib/src/widgets/scroll_controller.dart
+2
-2
No files found.
packages/flutter/lib/src/foundation/node.dart
View file @
c51fba97
...
...
@@ -87,6 +87,9 @@ class AbstractNode {
/// Subclasses with children should override this method to first call their
/// inherited [attach] method, and then [attach] all their children to the
/// same [owner].
///
/// Implementations of this method should start with a call to the inherited
/// method, as in `super.attach(owner)`.
@mustCallSuper
void
attach
(
covariant
Object
owner
)
{
assert
(
owner
!=
null
);
...
...
@@ -101,6 +104,9 @@ class AbstractNode {
///
/// Subclasses with children should override this method to first call their
/// inherited [detach] method, and then [detach] all their children.
///
/// Implementations of this method should end with a call to the inherited
/// method, as in `super.detach()`.
@mustCallSuper
void
detach
()
{
assert
(
_owner
!=
null
);
...
...
packages/flutter/lib/src/rendering/box.dart
View file @
c51fba97
...
...
@@ -2583,8 +2583,8 @@ abstract class RenderBox extends RenderObject {
/// object you can determine the [PointerDownEvent]'s position in local coordinates.
/// (This is useful because [PointerEvent.position] is in global coordinates.)
///
/// I
f you override this, consider calling [debugHandleEvent] as follows, so
///
that you can
support [debugPaintPointersEnabled]:
/// I
mplementations of this method should call [debugHandleEvent] as follows,
///
so that they
support [debugPaintPointersEnabled]:
///
/// ```dart
/// @override
...
...
packages/flutter/lib/src/rendering/viewport_offset.dart
View file @
c51fba97
...
...
@@ -242,8 +242,8 @@ abstract class ViewportOffset extends ChangeNotifier {
/// the [State] base class calls [debugFillDescription] to collect useful
/// information from subclasses to incorporate into its return value.
///
/// I
f you override this, make sure to start your method with a call to
/// `super.debugFillDescription(description)`.
/// I
mplementations of this method should start with a call to the inherited
///
method, as in
`super.debugFillDescription(description)`.
@mustCallSuper
void
debugFillDescription
(
List
<
String
>
description
)
{
if
(
hasPixels
)
{
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
c51fba97
...
...
@@ -979,8 +979,8 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
/// following this method, and [BuildContext.dependOnInheritedWidgetOfExactType] can
/// be used there.
///
/// I
f you override this, make sure your method starts with a call to
///
super.initState()
.
/// I
mplementations of this method should start with a call to the inherited
///
method, as in `super.initState()`
.
@protected
@mustCallSuper
void
initState
()
{
...
...
@@ -1003,8 +1003,8 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
///
/// {@macro flutter.widgets.State.initState}
///
/// I
f you override this, make sure your method starts with a call to
///
super.didUpdateWidget(oldWidget)
.
/// I
mplementations of this method should start with a call to the inherited
///
method, as in `super.didUpdateWidget(oldWidget)`
.
@mustCallSuper
@protected
void
didUpdateWidget
(
covariant
T
oldWidget
)
{
}
...
...
@@ -1147,8 +1147,8 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
/// this object and other elements in the tree (e.g. if you have provided an
/// ancestor with a pointer to a descendant's [RenderObject]).
///
/// I
f you override this, make sure to end your method with a call to
///
super.deactivate()
.
/// I
mplementations of this method should end with a call to the inherited
///
method, as in `super.deactivate()`
.
///
/// See also:
///
...
...
@@ -1171,8 +1171,8 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
///
/// {@macro flutter.widgets.State.initState}
///
/// I
f you override this, make sure to end your method with a call to
///
super.dispose()
.
/// I
mplementations of this method should end with a call to the inherited
///
method, as in `super.dispose()`
.
///
/// See also:
///
...
...
@@ -3406,6 +3406,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// [update], [visitChildren], [RenderObjectElement.insertRenderObjectChild],
/// [RenderObjectElement.moveRenderObjectChild], and
/// [RenderObjectElement.removeRenderObjectChild].
///
/// Implementations of this method should start with a call to the inherited
/// method, as in `super.mount(parent, newSlot)`.
@mustCallSuper
void
mount
(
Element
?
parent
,
dynamic
newSlot
)
{
assert
(
_lifecycleState
==
_ElementLifecycle
.
initial
);
...
...
@@ -3725,6 +3728,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// lifecycle state). Instead, the framework calls [mount] in that situation.
///
/// See the lifecycle documentation for [Element] for additional information.
///
/// Implementations of this method should start with a call to the inherited
/// method, as in `super.activate()`.
@mustCallSuper
void
activate
()
{
assert
(
_lifecycleState
==
_ElementLifecycle
.
inactive
);
...
...
@@ -3756,6 +3762,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// This is (indirectly) called by [deactivateChild].
///
/// See the lifecycle documentation for [Element] for additional information.
///
/// Implementations of this method should end with a call to the inherited
/// method, as in `super.deactivate()`.
@mustCallSuper
void
deactivate
()
{
assert
(
_lifecycleState
==
_ElementLifecycle
.
active
);
...
...
@@ -3794,6 +3803,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// the tree again.
///
/// See the lifecycle documentation for [Element] for additional information.
///
/// Implementations of this method should end with a call to the inherited
/// method, as in `super.unmount()`.
@mustCallSuper
void
unmount
()
{
assert
(
_lifecycleState
==
_ElementLifecycle
.
inactive
);
...
...
packages/flutter/lib/src/widgets/notification_listener.dart
View file @
c51fba97
...
...
@@ -152,8 +152,8 @@ abstract class Notification {
/// the [Notification] base class calls [debugFillDescription] to collect
/// useful information from subclasses to incorporate into its return value.
///
/// I
f you override this, make sure to start your method with a call to
/// `super.debugFillDescription(description)`.
/// I
mplementations of this method should start with a call to the inherited
///
method, as in
`super.debugFillDescription(description)`.
@protected
@mustCallSuper
void
debugFillDescription
(
List
<
String
>
description
)
{
}
...
...
packages/flutter/lib/src/widgets/scroll_controller.dart
View file @
c51fba97
...
...
@@ -255,8 +255,8 @@ class ScrollController extends ChangeNotifier {
/// the [ScrollController] base class calls [debugFillDescription] to collect
/// useful information from subclasses to incorporate into its return value.
///
/// I
f you override this, make sure to start your method with a call to
/// `super.debugFillDescription(description)`.
/// I
mplementations of this method should start with a call to the inherited
///
method, as in
`super.debugFillDescription(description)`.
@mustCallSuper
void
debugFillDescription
(
List
<
String
>
description
)
{
if
(
debugLabel
!=
null
)
...
...
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