diff --git a/packages/flutter/lib/src/foundation/node.dart b/packages/flutter/lib/src/foundation/node.dart index f1cdce01fd..26454748b1 100644 --- a/packages/flutter/lib/src/foundation/node.dart +++ b/packages/flutter/lib/src/foundation/node.dart @@ -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); diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 01c931471e..2975bd7b32 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -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.) /// - /// If you override this, consider calling [debugHandleEvent] as follows, so - /// that you can support [debugPaintPointersEnabled]: + /// Implementations of this method should call [debugHandleEvent] as follows, + /// so that they support [debugPaintPointersEnabled]: /// /// ```dart /// @override diff --git a/packages/flutter/lib/src/rendering/viewport_offset.dart b/packages/flutter/lib/src/rendering/viewport_offset.dart index fbe9472a72..9196e70e5f 100644 --- a/packages/flutter/lib/src/rendering/viewport_offset.dart +++ b/packages/flutter/lib/src/rendering/viewport_offset.dart @@ -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. /// - /// If you override this, make sure to start your method with a call to - /// `super.debugFillDescription(description)`. + /// Implementations of this method should start with a call to the inherited + /// method, as in `super.debugFillDescription(description)`. @mustCallSuper void debugFillDescription(List description) { if (hasPixels) { diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 42767a6837..50b479ab7f 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -979,8 +979,8 @@ abstract class State with Diagnosticable { /// following this method, and [BuildContext.dependOnInheritedWidgetOfExactType] can /// be used there. /// - /// If you override this, make sure your method starts with a call to - /// super.initState(). + /// Implementations 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 with Diagnosticable { /// /// {@macro flutter.widgets.State.initState} /// - /// If you override this, make sure your method starts with a call to - /// super.didUpdateWidget(oldWidget). + /// Implementations 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 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]). /// - /// If you override this, make sure to end your method with a call to - /// super.deactivate(). + /// Implementations 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 with Diagnosticable { /// /// {@macro flutter.widgets.State.initState} /// - /// If you override this, make sure to end your method with a call to - /// super.dispose(). + /// Implementations 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); diff --git a/packages/flutter/lib/src/widgets/notification_listener.dart b/packages/flutter/lib/src/widgets/notification_listener.dart index c3eed7115b..a5fef13a7d 100644 --- a/packages/flutter/lib/src/widgets/notification_listener.dart +++ b/packages/flutter/lib/src/widgets/notification_listener.dart @@ -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. /// - /// If you override this, make sure to start your method with a call to - /// `super.debugFillDescription(description)`. + /// Implementations of this method should start with a call to the inherited + /// method, as in `super.debugFillDescription(description)`. @protected @mustCallSuper void debugFillDescription(List description) { } diff --git a/packages/flutter/lib/src/widgets/scroll_controller.dart b/packages/flutter/lib/src/widgets/scroll_controller.dart index c5e34d04e1..bc7e3bd621 100644 --- a/packages/flutter/lib/src/widgets/scroll_controller.dart +++ b/packages/flutter/lib/src/widgets/scroll_controller.dart @@ -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. /// - /// If you override this, make sure to start your method with a call to - /// `super.debugFillDescription(description)`. + /// Implementations of this method should start with a call to the inherited + /// method, as in `super.debugFillDescription(description)`. @mustCallSuper void debugFillDescription(List description) { if (debugLabel != null)