ElRebuildWidget<W extends Widget> class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- ElRebuildWidget
- Available extensions
Constructors
-
ElRebuildWidget({Key? key, ElUpdateCallback<
W> ? shouldRebuild, required W child}) -
手动控制子组件重建,它会缓存当前 Widget 实例,如果未触发重建条件,
那么父组件重新 build 时将返回旧的 Widget 实例,此效果相当于添加 const 修饰符。
const
Properties
- child → W
-
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
-
shouldRebuild
→ ElUpdateCallback<
W> ? -
指定触发重建条件,当返回 true 时将允许子组件重建,
此回调为 null 或者返回 false 则不会重建子组件,因为它会复用旧的 Widget 实例
final
Methods
-
createElement(
) → Element -
Inflates this configuration to a concrete instance.
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
-
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited