mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
parent
ea24d14c0c
commit
04dca44f27
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ abstract class MultiDragGestureRecognizer<T extends MultiDragPointerState> 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);
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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() { }
|
||||
|
||||
|
||||
@ -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) { }
|
||||
|
||||
|
||||
@ -926,7 +926,7 @@ abstract class ParentDataWidget<T extends RenderObjectWidget> extends _ProxyWidg
|
||||
@override
|
||||
ParentDataElement<T> createElement() => new ParentDataElement<T>(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.
|
||||
///
|
||||
|
||||
@ -230,13 +230,13 @@ abstract class TransitionRoute<T> extends OverlayRoute<T> {
|
||||
|
||||
/// 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<dynamic> 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<dynamic> nextRoute) => true;
|
||||
|
||||
@ -490,7 +490,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
|
||||
|
||||
// The API for subclasses to override - used by _ModalScope
|
||||
|
||||
/// Override this function to build the primary content of this route.
|
||||
/// Override this method to build the primary content of this route.
|
||||
///
|
||||
/// * [context] The context in which the route is being built.
|
||||
/// * [animation] The animation for this route's transition. When entering,
|
||||
@ -501,7 +501,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
|
||||
/// and exit transition of routes pushed on top of this route.
|
||||
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> 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.
|
||||
|
||||
@ -545,7 +545,7 @@ class ScrollableState<T extends Scrollable> extends State<T> {
|
||||
|
||||
/// 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<T extends Scrollable> extends State<T> {
|
||||
|
||||
/// 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<T extends Scrollable> extends State<T> {
|
||||
|
||||
/// 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<T extends Scrollable> extends State<T> {
|
||||
|
||||
/// 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.
|
||||
|
||||
@ -22,7 +22,7 @@ abstract class StatusTransitionWidget extends StatefulWidget {
|
||||
/// The animation to which this widget is listening.
|
||||
final Animation<double> 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);
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ abstract class AnimatedWidget extends StatefulWidget {
|
||||
/// The animation to which this widget is listening.
|
||||
final Animation<Object> 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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user