ViewBuildContext<TViewModel extends ViewModel> class
abstract
ViewBuildContext
- Implemented types
- Implementers
Constructors
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< valueListenables, {required ValueWidgetBuilder<TValue> >Iterable< builder, Widget? child}) → WidgetTValue> > -
绑定到指定 ValueListenable 集合, 当
valueListenables
中 任一 ValueListenable 值发生变化时, 使用builder
构建 Widgetinherited -
$anyFor<
TValue> (Iterable< Object> prepertyKeys, {required ValueWidgetBuilder<Iterable< builder, Widget? child}) → WidgetTValue> > -
绑定到指定属性集合, 当任一
prepertyKeys
对应属性值发生变化时, 使用builder
构建 Widgetinherited -
$anyMap<
TValue> (Map< Object, ValueListenable< map, {required ValueWidgetBuilder<TValue> >Map< builder, Widget? child}) → WidgetObject, TValue> > -
绑定到指定 Map 键集合, 当
map
中任一 ValueListenable 值发生变化时, 使用builder
构建 Widgetinherited -
$anyMapFor<
TValue> (Map< Object, MapBehavior< prepertyKeyMap, {required ValueWidgetBuilder<TValue> ?>Map< builder, Widget? child}) → WidgetObject, TValue> > -
绑定到指定属性集合, 当任一
prepertyKeyMap
中对应的绑定属性值发生变化时, 使用builder
构建 Widgetinherited -
$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
构建 Widgetinherited -
$condFor<
TValue> (Object propertyKey, {ValueWidgetBuilder< TValue> ? $true, ValueWidgetBuilder<TValue> ? $false, Widget? child, bool valueHandle(TValue)?, TValue? initialValue}) → Widget -
绑定到指定属性, 当
propertyKey
对应属性值发生变化时, 若值判定结果为true
则使用$true
构建 Widget, 否则使用$false
构建 Widgetinherited -
$if<
TValue> (ValueListenable< TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, Widget? child, bool valueHandle(TValue)?}) → Widget -
绑定到指定 ValueListenable, 当
valueListenable
值发生变化时, 若值判定结果为true
则使用builder
构建 Widget, 否则不构建 Widgetinherited -
$ifFor<
TValue> (Object propertyKey, {required ValueWidgetBuilder< TValue> builder, Widget? child, bool valueHandle(TValue)?, TValue? initialValue}) → Widget -
绑定到指定属性, 当
propertyKey
对应属性值发生变化时, 若值判定结果为true
则使用builder
构建 Widget, 否则不构建 Widgetinherited -
$multi<
TValue> (Iterable< ValueListenable< valueListeneables, {required Widget builder(BuildContext context, TValue value, Widget? child, int index, ValueListenable<TValue> >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
选择器中提供的构建方法构建 Widgetinherited -
$switch<
TKey, TValue> (ValueListenable< TValue> valueListenable, {Map<TKey, ValueWidgetBuilder< ? options, ValueWidgetBuilder<TValue> >TValue> ? defalut, Widget? child, TKey valueToKey(TValue)?}) → Widget -
绑定到指定 ValueListenable, 当
valueListenable
值发生变化时, 其值做为key
到options
中查找对应 Widget 构建方法, 若未找到则使用default
构建, 如default
为null
则不构建 Widgetinherited -
$switchFor<
TKey, TValue> (Object propertyKey, {Map< TKey, ValueWidgetBuilder< ? options, ValueWidgetBuilder<TValue> >TValue> ? defalut, Widget? child, TKey valueToKey(TValue)?, TValue? initialValue}) → Widget -
绑定到指定属性, 当
propertyKey
对应属性值发生变化时, 其值做为key
到options
中查找对应 Widget 构建方法, 若未找到则使用default
构建, 如default
为null
则不构建 Widgetinherited -
$watch<
TValue> (ValueListenable< TValue> valueListenable, {required ValueWidgetBuilder<TValue> builder, Widget? child}) → Widget -
绑定到指定 ValueListenable, 当
valueListenable
值发生变化时, 使用builder
构建 Widgetinherited -
$watchFor<
TValue> (Object propertyKey, {required ValueWidgetBuilder< TValue> builder, Widget? child, TValue? initialValue}) → Widget -
绑定到指定属性, 当
propertyKey
对应属性值发生变化时, 使用builder
构建 Widgetinherited -
dependOnInheritedElement(
InheritedElement ancestor, {Object? aspect}) → InheritedWidget -
Registers this build context with
ancestor
such that whenancestor
'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