ViewBuildContext<TViewModel extends ViewModel> class abstract

ViewBuildContext

Implemented types
Implementers

Constructors

ViewBuildContext()

Properties

debugDoingBuild bool
Whether the widget is currently updating the widget or render tree.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
model → TViewModel
ViewModel
no setter
mounted bool
Whether the Widget this context is associated with is currently mounted in the widget tree.
no setterinherited
owner BuildOwner?
The BuildOwner for this context. The BuildOwner is in charge of managing the rendering pipeline for this context.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size?
The size of the RenderBox returned by findRenderObject.
no setterinherited
widget Widget
The current configuration of the Element that is this BuildContext.
no setterinherited

Methods

$any<TValue>(Iterable<ValueListenable<TValue>> valueListenables, {required ValueWidgetBuilder<Iterable<TValue>> builder, Widget? child}) Widget
绑定到指定 ValueListenable 集合, 当 valueListenables 中 任一 ValueListenable 值发生变化时, 使用 builder 构建 Widget
inherited
$anyFor<TValue>(Iterable<Object> prepertyKeys, {required ValueWidgetBuilder<Iterable<TValue>> builder, Widget? child}) Widget
绑定到指定属性集合, 当任一 prepertyKeys 对应属性值发生变化时, 使用 builder 构建 Widget
inherited
$anyMap<TValue>(Map<Object, ValueListenable<TValue>> map, {required ValueWidgetBuilder<Map<Object, TValue>> builder, Widget? child}) Widget
绑定到指定 Map 键集合, 当 map 中任一 ValueListenable 值发生变化时, 使用 builder 构建 Widget
inherited
$anyMapFor<TValue>(Map<Object, MapBehavior<TValue>?> prepertyKeyMap, {required ValueWidgetBuilder<Map<Object, TValue>> builder, Widget? child}) Widget
绑定到指定属性集合, 当任一 prepertyKeyMap 中对应的绑定属性值发生变化时, 使用 builder 构建 Widget
inherited
$build<TValue>(ValueListenable<TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, Widget? child}) Widget
构建 Widget
inherited
$buildOn<TValue>(ValueListenable<TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, required bool on(TValue value), Widget? child}) Widget
构建 Widget
inherited
$cond<TValue>(ValueListenable<TValue> valueListenable, {ValueWidgetBuilder<TValue>? $true, ValueWidgetBuilder<TValue>? $false, Widget? child, bool valueHandle(TValue)?}) Widget
绑定到指定 ValueListenable, 当 valueListenable 值发生变化时, 若值判定结果为 true 则使用 $true 构建 Widget, 否则使用 $false 构建 Widget
inherited
$condFor<TValue>(Object propertyKey, {ValueWidgetBuilder<TValue>? $true, ValueWidgetBuilder<TValue>? $false, Widget? child, bool valueHandle(TValue)?, TValue? initialValue}) Widget
绑定到指定属性, 当 propertyKey 对应属性值发生变化时, 若值判定结果为 true 则使用 $true 构建 Widget, 否则使用 $false 构建 Widget
inherited
$if<TValue>(ValueListenable<TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, Widget? child, bool valueHandle(TValue)?}) Widget
绑定到指定 ValueListenable, 当 valueListenable 值发生变化时, 若值判定结果为 true 则使用 builder 构建 Widget, 否则不构建 Widget
inherited
$ifFor<TValue>(Object propertyKey, {required ValueWidgetBuilder<TValue> builder, Widget? child, bool valueHandle(TValue)?, TValue? initialValue}) Widget
绑定到指定属性, 当 propertyKey 对应属性值发生变化时, 若值判定结果为 true 则使用 builder 构建 Widget, 否则不构建 Widget
inherited
$multi<TValue>(Iterable<ValueListenable<TValue>> valueListeneables, {required Widget builder(BuildContext context, TValue value, Widget? child, int index, ValueListenable<TValue> valueListeneable), Widget? childBuilder(int index)?}) List<Widget>
构建多个 Widget
inherited
$select<TValue>(ValueListenable<TValue> valueListenable, {required ValueWidgetBuilder<TValue>? selector(TValue), Widget? child}) Widget
绑定到指定 ValueListenable 当值发生变化时, 使用 selector 选择器中提供的构建方法构建 Widget
inherited
$switch<TKey, TValue>(ValueListenable<TValue> valueListenable, {Map<TKey, ValueWidgetBuilder<TValue>>? options, ValueWidgetBuilder<TValue>? defalut, Widget? child, TKey valueToKey(TValue)?}) Widget
绑定到指定 ValueListenable, 当 valueListenable 值发生变化时, 其值做为 keyoptions 中查找对应 Widget 构建方法, 若未找到则使用 default 构建, 如 defaultnull 则不构建 Widget
inherited
$switchFor<TKey, TValue>(Object propertyKey, {Map<TKey, ValueWidgetBuilder<TValue>>? options, ValueWidgetBuilder<TValue>? defalut, Widget? child, TKey valueToKey(TValue)?, TValue? initialValue}) Widget
绑定到指定属性, 当 propertyKey 对应属性值发生变化时, 其值做为 keyoptions 中查找对应 Widget 构建方法, 若未找到则使用 default 构建, 如 defaultnull 则不构建 Widget
inherited
$watch<TValue>(ValueListenable<TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, Widget? child}) Widget
绑定到指定 ValueListenable, 当 valueListenable 值发生变化时, 使用 builder 构建 Widget
inherited
$watchFor<TValue>(Object propertyKey, {required ValueWidgetBuilder<TValue> builder, Widget? child, TValue? initialValue}) Widget
绑定到指定属性, 当 propertyKey 对应属性值发生变化时, 使用 builder 构建 Widget
inherited
dependOnInheritedElement(InheritedElement ancestor, {Object? aspect}) InheritedWidget
Registers this build context with ancestor such that when ancestor's widget changes this build context is rebuilt.
inherited
dependOnInheritedWidgetOfExactType<T extends InheritedWidget>({Object? aspect}) → T?
Returns the nearest widget of the given type T and creates a dependency on it, or null if no appropriate widget is found.
inherited
describeElement(String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) DiagnosticsNode
Returns a description of the Element associated with the current build context.
inherited
describeMissingAncestor({required Type expectedAncestorType}) List<DiagnosticsNode>
Adds a description of a specific type of widget missing from the current build context's ancestry tree.
inherited
describeOwnershipChain(String name) DiagnosticsNode
Adds a description of the ownership chain from a specific Element to the error report.
inherited
describeWidget(String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) DiagnosticsNode
Returns a description of the Widget associated with the current build context.
inherited
dispatchNotification(Notification notification) → void
Start bubbling this notification at the given build context.
inherited
ensureProperty<TValue>(Object propertyKey, {TValue? initialValue}) BindableProperty<TValue>
确认指定 propertyKey 对应的绑定属性
inherited
findAncestorRenderObjectOfType<T extends RenderObject>() → T?
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget that is an instance of the given type T.
inherited
findAncestorStateOfType<T extends State<StatefulWidget>>() → T?
Returns the State object of the nearest ancestor StatefulWidget widget that is an instance of the given type T.
inherited
findAncestorWidgetOfExactType<T extends Widget>() → T?
Returns the nearest ancestor widget of the given type T, which must be the type of a concrete Widget subclass.
inherited
findRenderObject() RenderObject?
The current RenderObject for the widget. If the widget is a RenderObjectWidget, this is the render object that the widget created for itself. Otherwise, it is the render object of the first descendant RenderObjectWidget.
inherited
findRootAncestorStateOfType<T extends State<StatefulWidget>>() → T?
Returns the State object of the furthest ancestor StatefulWidget widget that is an instance of the given type T.
inherited
getElementForInheritedWidgetOfExactType<T extends InheritedWidget>() InheritedElement?
Obtains the element corresponding to the nearest widget of the given type T, which must be the type of a concrete InheritedWidget subclass.
inherited
getInheritedWidgetOfExactType<T extends InheritedWidget>() → T?
Returns the nearest widget of the given InheritedWidget subclass T or null if an appropriate ancestor is not found.
inherited
getProperties<TValue>(Iterable<Object> propertyKeys, {bool required = false}) Iterable<BindableProperty<TValue>?>
获取指定 propertyKeys 对应的属性集合
inherited
getProperty<TValue>(Object propertyKey, {bool required = false}) BindableProperty<TValue>?
获取指定 propertyKey 对应的属性
inherited
getPropertyOf<TValue, TProperty extends BindableProperty<TValue>>(Object propertyKey, {bool required = false}) → TProperty?
获取指定 propertyKey 对应 TProperty 类型属性
inherited
getValue<TValue>(Object propertyKey, {bool requiredProperty = false, TValue? defaultValue}) → TValue?
获取指定 propertyKey 对应的属性值
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(Object propertyKey, {bool requiredProperty = true}) → void
发送指定 propertyKey 对应的属性值变更通知
inherited
registerProperty<TValue>(Object propertyKey, BindableProperty<TValue> property) BindableProperty<TValue>
注册一个绑定属性
inherited
requireProperties<TValue>(Iterable<Object> propertyKeys) Iterable<BindableProperty<TValue>>
获取指定 propertyKeys 对应的属性集合
inherited
requireProperty<TValue>(Object propertyKey) BindableProperty<TValue>
获取指定 propertyKey 对应的属性
inherited
requirePropertyOf<TValue, TProperty extends BindableProperty<TValue>>(Object propertyKey) → TProperty
获取指定 propertyKey 对应 TProperty 类型属性
inherited
requireValue<TValue>(Object propertyKey) → TValue
获取指定 propertyKey 对应的属性值
inherited
setState(VoidCallback fn) → void
setState
setValue<TValue>(Object propertyKey, TValue value, {bool requiredProperty = true}) → void
设置指定 propertyKey 对应的属性值,
inherited
setValues(Iterable<Object> propertyKeys, Iterable<Object?> values, {bool requiredProperty = true}) → void
设置指定 propertyKeys 对应的属性值
inherited
toString() String
A string representation of this object.
inherited
updateValue<TValue>(Object propertyKey, TValue? updator(TValue), {bool requiredProperty = true}) → void
更新指定 propertyKey 对应的属性值
inherited
visitAncestorElements(ConditionalElementVisitor visitor) → void
Walks the ancestor chain, starting with the parent of this build context's widget, invoking the argument for each ancestor.
inherited
visitChildElements(ElementVisitor visitor) → void
Walks the children of this widget.
inherited

Operators

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