From 04dca44f274dc934ffd2f367fa28a8925751675f Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 6 Jul 2016 18:45:42 -0700 Subject: [PATCH] Be consistent about method versus function (#4828) Fixes #4761 --- packages/flutter/lib/src/gestures/hit_test.dart | 4 ++-- packages/flutter/lib/src/gestures/multidrag.dart | 2 +- .../flutter/lib/src/gestures/recognizer.dart | 2 +- packages/flutter/lib/src/rendering/box.dart | 16 ++++++++-------- packages/flutter/lib/src/rendering/grid.dart | 4 ++-- packages/flutter/lib/src/rendering/layer.dart | 2 +- packages/flutter/lib/src/rendering/node.dart | 2 +- packages/flutter/lib/src/rendering/object.dart | 8 ++++---- packages/flutter/lib/src/widgets/framework.dart | 2 +- packages/flutter/lib/src/widgets/routes.dart | 8 ++++---- packages/flutter/lib/src/widgets/scrollable.dart | 8 ++++---- .../lib/src/widgets/status_transitions.dart | 2 +- .../flutter/lib/src/widgets/transitions.dart | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/flutter/lib/src/gestures/hit_test.dart b/packages/flutter/lib/src/gestures/hit_test.dart index efa83d5b3fa..6e7a7e6c7be 100644 --- a/packages/flutter/lib/src/gestures/hit_test.dart +++ b/packages/flutter/lib/src/gestures/hit_test.dart @@ -15,13 +15,13 @@ abstract class HitTestable { // ignore: one_member_abstracts /// An object that can dispatch events. abstract class HitTestDispatcher { // ignore: one_member_abstracts - /// Override this function to dispatch events. + /// Override this method to dispatch events. void dispatchEvent(PointerEvent event, HitTestResult result); } /// An object that can handle events. abstract class HitTestTarget { // ignore: one_member_abstracts - /// Override this function to receive events. + /// Override this method to receive events. void handleEvent(PointerEvent event, HitTestEntry entry); } diff --git a/packages/flutter/lib/src/gestures/multidrag.dart b/packages/flutter/lib/src/gestures/multidrag.dart index fcfcad0b9e8..047542c5ae7 100644 --- a/packages/flutter/lib/src/gestures/multidrag.dart +++ b/packages/flutter/lib/src/gestures/multidrag.dart @@ -193,7 +193,7 @@ abstract class MultiDragGestureRecognizer exten state._setArenaEntry(GestureBinding.instance.gestureArena.add(event.pointer, this)); } - /// Subclasses should override this function to create per-pointer state + /// Subclasses should override this method to create per-pointer state /// objects to track the pointer associated with the given event. T createNewPointerState(PointerDownEvent event); diff --git a/packages/flutter/lib/src/gestures/recognizer.dart b/packages/flutter/lib/src/gestures/recognizer.dart index 0d3e8b93bd5..08592a6e2d0 100644 --- a/packages/flutter/lib/src/gestures/recognizer.dart +++ b/packages/flutter/lib/src/gestures/recognizer.dart @@ -206,7 +206,7 @@ abstract class PrimaryPointerGestureRecognizer extends OneSequenceGestureRecogni /// Override to be notified when [deadline] is exceeded. /// - /// You must override this function if you supply a [deadline]. + /// You must override this method if you supply a [deadline]. void didExceedDeadline() { assert(deadline == null); } diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 7df2485ff6f..cc775a5310d 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -552,7 +552,7 @@ abstract class RenderBox extends RenderObject { /// Calling this function is expensive and as it can result in O(N^2) /// behavior. /// - /// Do not override this function. Instead, implement [computeMinIntrinsicWidth]. + /// Do not override this method. Instead, implement [computeMinIntrinsicWidth]. @mustCallSuper double getMinIntrinsicWidth(double height) { return _computeIntrinsicDimension(_IntrinsicDimension.minWidth, height, computeMinIntrinsicWidth); @@ -652,7 +652,7 @@ abstract class RenderBox extends RenderObject { /// Calling this function is expensive and as it can result in O(N^2) /// behavior. /// - /// Do not override this function. Instead, implement + /// Do not override this method. Instead, implement /// [computeMaxIntrinsicWidth]. @mustCallSuper double getMaxIntrinsicWidth(double height) { @@ -707,7 +707,7 @@ abstract class RenderBox extends RenderObject { /// Calling this function is expensive and as it can result in O(N^2) /// behavior. /// - /// Do not override this function. Instead, implement + /// Do not override this method. Instead, implement /// [computeMinIntrinsicHeight]. @mustCallSuper double getMinIntrinsicHeight(double width) { @@ -754,7 +754,7 @@ abstract class RenderBox extends RenderObject { /// Calling this function is expensive and as it can result in O(N^2) /// behavior. /// - /// Do not override this function. Instead, implement + /// Do not override this method. Instead, implement /// [computeMaxIntrinsicHeight]. @mustCallSuper double getMaxIntrinsicHeight(double width) { @@ -952,7 +952,7 @@ abstract class RenderBox extends RenderObject { /// are implementing [computeDistanceToActualBaseline] and need to defer to a /// child. /// - /// Subclasses should override this function to supply the distances to their + /// Subclasses should override this method to supply the distances to their /// baselines. @protected double computeDistanceToActualBaseline(TextBaseline baseline) { @@ -1174,7 +1174,7 @@ abstract class RenderBox extends RenderObject { return false; } - /// Override this function if this render object can be hit even if its + /// Override this method if this render object can be hit even if its /// children were not hit. /// /// Used by [hitTest]. If you override [hitTest] and do not call this @@ -1182,7 +1182,7 @@ abstract class RenderBox extends RenderObject { @protected bool hitTestSelf(Point position) => false; - /// Override this function to check whether any children are located at the + /// Override this method to check whether any children are located at the /// given position. /// /// Typically children should be hit tested in reverse paint order so that @@ -1261,7 +1261,7 @@ abstract class RenderBox extends RenderObject { int _debugActivePointers = 0; - /// Override this function to handle pointer events that hit this render object. + /// Override this method to handle pointer events that hit this render object. /// /// For [RenderBox] objects, the `entry` argument is a [BoxHitTestEntry]. From this /// object you can determine the [PointerDownEvent]'s position in local coordinates. diff --git a/packages/flutter/lib/src/rendering/grid.dart b/packages/flutter/lib/src/rendering/grid.dart index 0267db739b8..42c3fe3ff95 100644 --- a/packages/flutter/lib/src/rendering/grid.dart +++ b/packages/flutter/lib/src/rendering/grid.dart @@ -187,10 +187,10 @@ class GridChildPlacement { /// An abstract interface to control the layout of a [RenderGrid]. abstract class GridDelegate { - /// Override this function to control size of the columns and rows. + /// Override this method to control size of the columns and rows. GridSpecification getGridSpecification(BoxConstraints constraints, int childCount); - /// Override this function to control where children are placed in the grid. + /// Override this method to control where children are placed in the grid. /// /// During layout, the grid calls this function for each child, passing the /// [placementData] associated with that child as context. The returned diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index 7e8be48e5c9..0ba4c8243cd 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -65,7 +65,7 @@ abstract class Layer { _parent = null; } - /// Override this function to upload this layer to the engine + /// Override this method to upload this layer to the engine /// /// The layerOffset is the accumulated offset of this layer's parent from the /// origin of the builder's coordinate system. diff --git a/packages/flutter/lib/src/rendering/node.dart b/packages/flutter/lib/src/rendering/node.dart index b9b4785822b..3adf5fe799f 100644 --- a/packages/flutter/lib/src/rendering/node.dart +++ b/packages/flutter/lib/src/rendering/node.dart @@ -61,7 +61,7 @@ class AbstractNode { } } - /// Override this function in subclasses with child nodes to call + /// Override this method in subclasses with child nodes to call /// redepthChild(child) for each child. Do not call directly. void redepthChildren() { } diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 603117b6df3..679640e749f 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -1525,7 +1525,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { /// render object during layout. The layout constraints provided by your /// parent are available via the [constraints] getter. /// - /// Subclasses that set [sizedByParent] to true should override this function + /// Subclasses that set [sizedByParent] to true should override this method /// to compute their size. /// /// This function is called only if [sizedByParent] is true. @@ -1827,13 +1827,13 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { /// layer. Rect get paintBounds; - /// Override this function to paint debugging information. + /// Override this method to paint debugging information. @protected void debugPaint(PaintingContext context, Offset offset) { } /// Paint this render object into the given context at the given offset. /// - /// Subclasses should override this function to provide a visual appearance + /// Subclasses should override this method to provide a visual appearance /// for themselves. The render object's local coordinate system is /// axis-aligned with the coordinate system of the context's canvas and the /// render object's local origin (i.e, x=0 and y=0) is placed at the given @@ -2094,7 +2094,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { // EVENTS - /// Override this function to handle pointer events that hit this render object. + /// Override this method to handle pointer events that hit this render object. @override void handleEvent(PointerEvent event, HitTestEntry entry) { } diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 0161291a086..65d16acb3b0 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -926,7 +926,7 @@ abstract class ParentDataWidget extends _ProxyWidg @override ParentDataElement createElement() => new ParentDataElement(this); - /// Subclasses should override this function to return true if the given + /// Subclasses should override this method to return true if the given /// ancestor is a RenderObjectWidget that wraps a RenderObject that can handle /// the kind of ParentData widget that the ParentDataWidget subclass handles. /// diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 8fc2b429f94..d73f4da491e 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -230,13 +230,13 @@ abstract class TransitionRoute extends OverlayRoute { /// Whether this route can perform a transition to the given route. /// - /// Subclasses can override this function to restrict the set of routes they + /// Subclasses can override this method to restrict the set of routes they /// need to coordinate transitions with. bool canTransitionTo(TransitionRoute nextRoute) => true; /// Whether this route can perform a transition from the given route. /// - /// Subclasses can override this function to restrict the set of routes they + /// Subclasses can override this method to restrict the set of routes they /// need to coordinate transitions with. bool canTransitionFrom(TransitionRoute nextRoute) => true; @@ -490,7 +490,7 @@ abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute extends TransitionRoute with LocalHistoryRoute animation, Animation forwardAnimation); - /// Override this function to wrap the route in a number of transition widgets. + /// Override this method to wrap the route in a number of transition widgets. /// /// For example, to create a fade entrance transition, wrap the given child /// widget in a [FadeTransition] using the given animation as the opacity. diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index 671b5ba94c8..5faf123de02 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -545,7 +545,7 @@ class ScrollableState extends State { /// Calls the onScroll callback. /// - /// Subclasses can override this function to hook the scroll callback. + /// Subclasses can override this method to hook the scroll callback. void dispatchOnScroll() { assert(_numberOfInProgressScrolls > 0); if (config.onScroll != null) @@ -575,7 +575,7 @@ class ScrollableState extends State { /// Calls the onScrollStart callback. /// - /// Subclasses can override this function to hook the scroll start callback. + /// Subclasses can override this method to hook the scroll start callback. void dispatchOnScrollStart() { assert(_numberOfInProgressScrolls == 1); if (config.onScrollStart != null) @@ -603,7 +603,7 @@ class ScrollableState extends State { /// Calls the dispatchOnScrollEnd callback. /// - /// Subclasses can override this function to hook the scroll end callback. + /// Subclasses can override this method to hook the scroll end callback. void dispatchOnScrollEnd() { assert(_numberOfInProgressScrolls == 0); if (config.onScrollEnd != null) @@ -672,7 +672,7 @@ class ScrollableState extends State { /// Calls the widget's [builder] by default. /// - /// Subclasses can override this function to build the interior of their + /// Subclasses can override this method to build the interior of their /// scrollable widget. Scrollable wraps the returned widget in a /// [GestureDetector] to observe the user's interaction with this widget and /// to adjust the scroll offset accordingly. diff --git a/packages/flutter/lib/src/widgets/status_transitions.dart b/packages/flutter/lib/src/widgets/status_transitions.dart index 38e5bdb68dd..f736b3acbdd 100644 --- a/packages/flutter/lib/src/widgets/status_transitions.dart +++ b/packages/flutter/lib/src/widgets/status_transitions.dart @@ -22,7 +22,7 @@ abstract class StatusTransitionWidget extends StatefulWidget { /// The animation to which this widget is listening. final Animation animation; - /// Override this function to build widgets that depend on the current status + /// Override this method to build widgets that depend on the current status /// of the animation. Widget build(BuildContext context); diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 1f0b41f0500..76755184340 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -33,7 +33,7 @@ abstract class AnimatedWidget extends StatefulWidget { /// The animation to which this widget is listening. final Animation animation; - /// Override this function to build widgets that depend on the current value + /// Override this method to build widgets that depend on the current value /// of the animation. Widget build(BuildContext context);