ElChildSizeBuilder class

Inheritance
Available extensions

Constructors

ElChildSizeBuilder({Key? key, BoxConstraints? constraints, required Widget tempChild, required Widget builder(Size size)})
在 build 过程中直接访问 child 尺寸的小部件,无需帧后回调,其核心原理便是在进行实际布局前探测 tempChild 的尺寸, 然后将 size 传递给 builder 方法。
const

Properties

builder Widget Function(Size size)
实际构建的小部件,其回调参数便是 tempChild 的尺寸
final
constraints BoxConstraints?
tempChild 添加尺寸约束,默认情况下 tempChild 使用的是 ElChildSizeBuilder 父级的尺寸约束, 但如果你实际构建的组件间接引用了新的约束,那么你应当将此约束应用给 tempChild
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tempChild Widget
需要计算尺寸的临时小部件,它参与布局但不进行渲染,布局完成后会拿到 size 并传递给 builder 回调
final

Methods

createElement() RenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
override
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
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
noScrollbarBehavior(BuildContext context, {Key? key, bool? overscroll, bool enabled = true}) Widget

Available on Widget, provided by the FlutterWidgetExt extension

不使用祖先提供的默认滚动条,当使用自定义滚动条时请添加此扩展方法,防止与祖先提供的默认滚动条重叠
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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 RenderObject 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

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isTempLayout(BuildContext context) bool
判断组件是否处于临时布局中