LayoutOnCreated class
组件首次渲染完成 LayoutOnCreated(onCreated: (value){ print('----LayoutCreated:${value.rect}'); }, child: Text("计数:${count}") )
参考:https://book.flutterchina.club/chapter4/layoutbuilder.html#_4-8-2-afterlayout
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- RenderObjectWidget
- SingleChildRenderObjectWidget
- LayoutOnCreated
- Available extensions
Constructors
-
LayoutOnCreated({Key? key, required ValueSetter<
RenderLayoutOnCreated> onRendered, Widget? child}) -
const
Properties
- child → Widget?
-
The widget below this widget in the tree.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onRendered
→ ValueSetter<
RenderLayoutOnCreated> -
onCreated组件布局完成final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
absorbPointer(
{Key? key, bool absorbing = true}) → AbsorbPointer -
Available on Widget, provided by the WidgetChainExt extension
用AbsorbPointer包裹当前组件 -
align(
{AlignmentGeometry alignment = Alignment.center, Key? key, double? widthFactor, double? heightFactor}) → Align -
Available on Widget, provided by the WidgetChainExt extension
用Align包裹当前组件 -
center(
{Key? key, AlignmentGeometry alignment = Alignment.center, double? widthFactor, double? heightFactor}) → Align -
Available on Widget, provided by the WidgetChainExt extension
用Center包裹当前组件 -
click(
GestureTapCallback? onTap) → Widget -
Available on Widget, provided by the WidgetChainExt extension
有点击效果的点击事件 -
clipOval(
{Key? key, Clip clipBehavior = Clip.antiAlias, CustomClipper< Rect> ? clipper}) → ClipOval -
Available on Widget, provided by the WidgetChainExt extension
-
clipPath(
{Key? key, Clip clipBehavior = Clip.antiAlias, CustomClipper< Path> ? clipper}) → ClipPath -
Available on Widget, provided by the WidgetChainExt extension
-
clipRect(
{Key? key, Clip clipBehavior = Clip.antiAlias, CustomClipper< Rect> ? clipper}) → ClipRect -
Available on Widget, provided by the WidgetChainExt extension
-
clipRRect(
{Key? key, BorderRadiusGeometry borderRadius = BorderRadius.zero, Clip clipBehavior = Clip.antiAlias, CustomClipper< RRect> ? clipper}) → ClipRRect -
Available on Widget, provided by the WidgetChainExt extension
-
coloredBox(
Color color, {Key? key}) → ColoredBox -
Available on Widget, provided by the WidgetChainExt extension
用ColoredBox包裹当前组件 -
constrainedBox(
BoxConstraints constraints, {Key? key}) → ConstrainedBox -
Available on Widget, provided by the WidgetChainExt extension
用ConstrainedBox包裹当前组件 -
container(
{Key? key, AlignmentGeometry? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none}) → Container -
Available on Widget, provided by the WidgetChainExt extension
用Container包裹当前组件 -
createElement(
) → SingleChildRenderObjectElement -
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
-
createRenderObject(
BuildContext context) → RenderObject -
Creates an instance of the RenderObject class that this
RenderObjectWidget represents, using the configuration described by this
RenderObjectWidget.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
decoratedBox(
Decoration decoration, {Key? key, DecorationPosition position = DecorationPosition.background}) → DecoratedBox -
Available on Widget, provided by the WidgetChainExt extension
用DecoratedBox包裹当前组件 -
didUnmountRenderObject(
covariant RenderObject renderObject) → void -
This method is called when a RenderObject that was previously
associated with this widget is removed from the render tree.
The provided RenderObject will be of the same type as the one created by
this widget's createRenderObject method.
inherited
-
enfold(
Widget builder(Widget child)) → Widget -
Available on Widget, provided by the WidgetChainExt extension
包裹当前组件 -
expanded(
int flex, {Key? key}) → Expanded -
Available on Widget, provided by the WidgetChainExt extension
用Expanded包裹当前组件 -
gestureDetector(
{Key? key, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCallback? onTap, GestureTapCancelCallback? onTapCancel, GestureTapCallback? onSecondaryTap, GestureTapDownCallback? onSecondaryTapDown, GestureTapUpCallback? onSecondaryTapUp, GestureTapCancelCallback? onSecondaryTapCancel, GestureTapDownCallback? onTertiaryTapDown, GestureTapUpCallback? onTertiaryTapUp, GestureTapCancelCallback? onTertiaryTapCancel, GestureTapDownCallback? onDoubleTapDown, GestureTapCallback? onDoubleTap, GestureTapCancelCallback? onDoubleTapCancel, GestureLongPressDownCallback? onLongPressDown, GestureLongPressCancelCallback? onLongPressCancel, GestureLongPressCallback? onLongPress, GestureLongPressStartCallback? onLongPressStart, GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate, GestureLongPressUpCallback? onLongPressUp, GestureLongPressEndCallback? onLongPressEnd, GestureLongPressDownCallback? onSecondaryLongPressDown, GestureLongPressCancelCallback? onSecondaryLongPressCancel, GestureLongPressCallback? onSecondaryLongPress, GestureLongPressStartCallback? onSecondaryLongPressStart, GestureLongPressMoveUpdateCallback? onSecondaryLongPressMoveUpdate, GestureLongPressUpCallback? onSecondaryLongPressUp, GestureLongPressEndCallback? onSecondaryLongPressEnd, GestureLongPressDownCallback? onTertiaryLongPressDown, GestureLongPressCancelCallback? onTertiaryLongPressCancel, GestureLongPressCallback? onTertiaryLongPress, GestureLongPressStartCallback? onTertiaryLongPressStart, GestureLongPressMoveUpdateCallback? onTertiaryLongPressMoveUpdate, GestureLongPressUpCallback? onTertiaryLongPressUp, GestureLongPressEndCallback? onTertiaryLongPressEnd, GestureDragDownCallback? onVerticalDragDown, GestureDragStartCallback? onVerticalDragStart, GestureDragUpdateCallback? onVerticalDragUpdate, GestureDragEndCallback? onVerticalDragEnd, GestureDragCancelCallback? onVerticalDragCancel, GestureDragDownCallback? onHorizontalDragDown, GestureDragStartCallback? onHorizontalDragStart, GestureDragUpdateCallback? onHorizontalDragUpdate, GestureDragEndCallback? onHorizontalDragEnd, GestureDragCancelCallback? onHorizontalDragCancel, GestureForcePressStartCallback? onForcePressStart, GestureForcePressPeakCallback? onForcePressPeak, GestureForcePressUpdateCallback? onForcePressUpdate, GestureForcePressEndCallback? onForcePressEnd, GestureDragDownCallback? onPanDown, GestureDragStartCallback? onPanStart, GestureDragUpdateCallback? onPanUpdate, GestureDragEndCallback? onPanEnd, GestureDragCancelCallback? onPanCancel, GestureScaleStartCallback? onScaleStart, GestureScaleUpdateCallback? onScaleUpdate, GestureScaleEndCallback? onScaleEnd, HitTestBehavior? behavior, bool excludeFromSemantics = false, DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool trackpadScrollCausesScale = false, Offset trackpadScrollToScaleFactor = kDefaultTrackpadScrollToScaleFactor, Set< PointerDeviceKind> ? supportedDevices}) → GestureDetector -
Available on Widget, provided by the WidgetChainExt extension
用GestureDetector包裹当前组件 -
ignorePointer(
{Key? key, bool ignoring = true}) → IgnorePointer -
Available on Widget, provided by the WidgetChainExt extension
用IgnorePointer包裹当前组件 -
inkWell(
{Key? key, GestureTapCallback? onTap, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCallback? onTapCancel, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, GestureTapCallback? onSecondaryTap, GestureTapUpCallback? onSecondaryTapUp, GestureTapDownCallback? onSecondaryTapDown, GestureTapCallback? onSecondaryTapCancel, ValueChanged< bool> ? onHighlightChanged, ValueChanged<bool> ? onHover, MouseCursor? mouseCursor, bool containedInkWell = false, BoxShape highlightShape = BoxShape.circle, double? radius, BorderRadius? borderRadius, ShapeBorder? customBorder, Color? focusColor, Color? hoverColor, Color? highlightColor, MaterialStateProperty<Color?> ? overlayColor, Color? splashColor, InteractiveInkFeatureFactory? splashFactory, bool enableFeedback = true, bool excludeFromSemantics = false, FocusNode? focusNode, bool canRequestFocus = true, ValueChanged<bool> ? onFocusChange, bool autofocus = false, MaterialStatesController? statesController, Duration? hoverDuration}) → InkWell -
Available on Widget, provided by the WidgetChainExt extension
用InkWell包裹当前组件 -
margin(
EdgeInsetsGeometry margin, {Key? key}) → Padding -
Available on Widget, provided by the WidgetChainExt extension
用Padding包裹当前组件 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offstage(
bool offstage, {Key? key}) → Offstage -
Available on Widget, provided by the WidgetChainExt extension
用Offstage包裹当前组件 -
opacity(
double opacity, {Key? key, bool alwaysIncludeSemantics = false}) → Opacity -
Available on Widget, provided by the WidgetChainExt extension
用Opacity包裹当前组件 -
padding(
EdgeInsetsGeometry padding, {Key? key}) → Padding -
Available on Widget, provided by the WidgetChainExt extension
用Padding包裹当前组件 -
positioned(
{Key? key, double? left, double? top, double? right, double? bottom, double? width, double? height}) → Positioned -
Available on Widget, provided by the WidgetChainExt extension
用Positioned包裹当前组件 -
repaintBoundary(
{Key? key}) → RepaintBoundary -
Available on Widget, provided by the WidgetChainExt extension
-
safeArea(
{Key? key, bool left = true, bool top = true, bool right = true, bool bottom = true, EdgeInsets minimum = EdgeInsets.zero, bool maintainBottomViewPadding = false}) → SafeArea -
Available on Widget, provided by the WidgetChainExt extension
-
singleChildScrollView(
{Key? key, Axis scrollDirection = Axis.vertical, bool reverse = false, EdgeInsetsGeometry? padding, bool? primary, ScrollPhysics? physics, ScrollController? controller, dynamic child, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Clip clipBehavior = Clip.hardEdge, String? restorationId, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual}) → SingleChildScrollView -
Available on Widget, provided by the WidgetChainExt extension
-
sizedBox(
{Key? key, double? width, double? height}) → SizedBox -
Available on Widget, provided by the WidgetChainExt extension
-
tap(
GestureTapCallback? onTap) → Widget -
Available on Widget, provided by the WidgetChainExt extension
点击事件 -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
updateRenderObject(
BuildContext context, covariant RenderLayoutOnCreated renderObject) → void -
Copies the configuration described by this RenderObjectWidget to the
given RenderObject, which will be of the same type as returned by this
object's createRenderObject.
override
-
visibility(
bool visible, {Key? key, Widget replacement = const SizedBox.shrink(), bool maintainState = false, bool maintainAnimation = false, bool maintainSize = false, bool maintainSemantics = false, bool maintainInteractivity = false}) → Visibility -
Available on Widget, provided by the WidgetChainExt extension
用Visibility包裹当前组件 -
widgetSpan(
{PlaceholderAlignment alignment = PlaceholderAlignment.bottom, TextBaseline? baseline, TextStyle? style}) → WidgetSpan -
Available on Widget, provided by the WidgetChainExt extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited