BindElement<T> class
The BindElement is responsible for injecting dependencies into the widget tree so that they can be observed
- Inheritance
- Available extensions
Constructors
-
BindElement(Binder<
T> widget)
Properties
- arguments → dynamic
-
Available on BuildContext, provided by the PageArgExt extension
no setter - buildScope → BuildScope
-
A BuildScope whose dirty Elements can only be rebuilt by
BuildOwner.buildScope calls whose
context
argument is an Element within this BuildScope.no setterinherited - controller → T
-
no setter
- debugDoingBuild → bool
-
Whether the widget is currently updating the widget or render tree.
no setterinherited
- debugIsActive → bool
-
Returns true if the Element is active.
no setterinherited
- debugIsDefunct → bool
-
Returns true if the Element is defunct.
no setterinherited
- delegate → GetDelegate
-
Available on BuildContext, provided by the PageArgExt extension
no setter - depth → int
-
An integer that is guaranteed to be greater than the parent's, if any.
The element at the root of the tree must have a depth greater than 0.
no setterinherited
- devicePixelRatio → double
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.devicePixelRatioOf(context)no setter - dirty → bool
-
Returns true if the element has been marked as needing rebuilding.
no setterinherited
-
disposers
→ List<
Disposer> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Available on BuildContext, provided by the ContextExt extension
The same of MediaQuery.of(context).size.height Note: updates when you resize your screen (like on a browser or desktop window)no setter - iconColor → Color?
-
Available on BuildContext, provided by the ContextExt extension
give access to Theme.of(context).iconTheme.colorno setter - isDarkMode → bool
-
Available on BuildContext, provided by the ContextExt extension
Check if dark mode theme is enableno setter - isDesktop → bool
-
Available on BuildContext, provided by the ContextExt extension
same as isDesktopOrLessno setter - isDesktopOrLess → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is smaller than 1200pno setter - isDesktopOrWider → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is higher than 1200pno setter - isLandscape → bool
-
Available on BuildContext, provided by the ContextExt extension
check if device is on landscape modeno setter - isLargeTablet → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the shortestSide is largest than 720pno setter - isLargeTabletOrLess → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is smaller than 720pno setter - isLargeTabletOrWider → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is higher than 720pno setter - isPhone → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the shortestSide is smaller than 600pno setter - isPhoneOrLess → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is smaller than 600pno setter - isPhoneOrWider → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is higher than 600pno setter - isPortrait → bool
-
Available on BuildContext, provided by the ContextExt extension
check if device is on portrait modeno setter - isSmallTablet → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the shortestSide is largest than 600pno setter - isSmallTabletOrLess → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is smaller than 600pno setter - isSmallTabletOrWider → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the width is higher than 600pno setter - isTablet → bool
-
Available on BuildContext, provided by the ContextExt extension
True if the current device is Tabletno setter - location → String
-
Available on BuildContext, provided by the PageArgExt extension
no setter - mediaQuery → MediaQueryData
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.of(context).paddingno setter - mediaQueryPadding → EdgeInsets
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.paddingOf(context)no setter - mediaQueryShortestSide → double
-
Available on BuildContext, provided by the ContextExt extension
get the shortestSide from screenno setter - mediaQuerySize → Size
-
Available on BuildContext, provided by the ContextExt extension
The same of MediaQuery.sizeOf(context)no setter - mediaQueryViewInsets → EdgeInsets
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.viewInsetsOf(context)no setter - mediaQueryViewPadding → EdgeInsets
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.viewPaddingOf(context)no setter - mounted → bool
-
Whether the Widget this context is associated with is currently
mounted in the widget tree.
no setterinherited
- orientation → Orientation
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.orientationOf(context)no setter - owner → BuildOwner?
-
The object that manages the lifecycle of this element.
no setterinherited
- pageSettings → PageSettings?
-
Available on BuildContext, provided by the PageArgExt extension
no setter -
params
→ Map<
String, String> -
Available on BuildContext, provided by the PageArgExt extension
no setter -
Available on BuildContext, provided by the NavKeyExt extension
no setter - renderObject → RenderObject?
-
The render object at (or below) this location in the tree.
no setterinherited
- renderObjectAttachingChild → Element?
-
Returns the child of this Element that will insert a RenderObject into
an ancestor of this Element to construct the render tree.
no setterinherited
- router → Router
-
Available on BuildContext, provided by the PageArgExt extension
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → RouteSettings?
-
Available on BuildContext, provided by the PageArgExt extension
no setter -
Available on BuildContext, provided by the ContextExt extension
True if width be larger than 800no setter - size → Size?
-
The size of the RenderBox returned by findRenderObject.
no setterinherited
- slot → Object?
-
Information set by parent to define where this child fits in its parent's
child list.
no setterinherited
- textScaleFactor → TextScaler
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.textScaleFactorOf(context)no setter - textTheme → TextTheme
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.of(context).paddingno setter - theme → ThemeData
-
Available on BuildContext, provided by the ContextExt extension
similar to MediaQuery.of(context).paddingno setter -
widget
→ Binder<
T> -
The configuration for this element.
no setteroverride
- width → double
-
Available on BuildContext, provided by the ContextExt extension
The same of MediaQuery.of(context).size.width Note: updates when you resize your screen (like on a browser or desktop window)no setter
Methods
-
activate(
) → void -
Transition from the "inactive" to the "active" lifecycle state.
inherited
-
attachNotificationTree(
) → void -
Called in Element.mount and Element.activate to register this element in
the notification tree.
inherited
-
attachRenderObject(
Object? newSlot) → void -
Add renderObject to the render tree at the location specified by
newSlot
.inherited -
build(
) → Widget -
Subclasses should override this function to actually call the appropriate
build
function (e.g., StatelessWidget.build or State.build) for their widget.override -
deactivate(
) → void -
Transition from the "active" to the "inactive" lifecycle state.
inherited
-
deactivateChild(
Element child) → void -
Move the given element to the list of inactive elements and detach its
render object from the render tree.
inherited
-
debugDeactivated(
) → void -
Called, in debug mode, after children have been deactivated (see deactivate).
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugExpectsRenderObjectForSlot(
Object? slot) → bool -
Whether the child in the provided
slot
(or one of its descendants) must insert a RenderObject into its ancestor RenderObjectElement by calling RenderObjectElement.insertRenderObjectChild on it.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
debugGetCreatorChain(
int limit) → String -
Returns a description of what caused this element to be created.
inherited
-
debugGetDiagnosticChain(
) → List< Element> -
Returns the parent chain from this element back to the root of the tree.
inherited
-
debugVisitOnstageChildren(
ElementVisitor visitor) → void -
Calls the argument for each child considered onstage.
inherited
-
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
-
detachRenderObject(
) → void -
Remove renderObject from the render tree.
inherited
-
didChangeDependencies(
) → void -
Called when a dependency of this element changes.
override
-
dispatchNotification(
Notification notification) → void -
Start bubbling this notification at the given build context.
inherited
-
dispose(
) → void -
doesDependOnInheritedElement(
InheritedElement ancestor) → bool -
Returns
true
if dependOnInheritedElement was previously called withancestor
.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 -
forgetChild(
Element child) → void -
Remove the given child from the element's child list, in preparation for
the child being reused elsewhere in the element tree.
inherited
-
get<
T> () → T -
Available on BuildContext, provided by the ReadExt extension
-
getDependencies(
Element dependent) → Object? -
Returns the dependencies value recorded for
dependent
with setDependencies.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 -
getUpdate(
) → void -
heightTransformer(
{double dividedBy = 1, double reducedBy = 0.0}) → double -
Available on BuildContext, provided by the ContextExt extension
Gives you the power to get a portion of the height. Useful for responsive applications. -
inflateWidget(
Widget newWidget, Object? newSlot) → Element -
Create an element for the given widget and add it as a child of this
element in the given slot.
inherited
-
initState(
) → void -
listen<
T> () → T -
Available on BuildContext, provided by the WatchExt extension
-
markNeedsBuild(
) → void -
Marks the element as dirty and adds it to the global list of widgets to
rebuild in the next frame.
inherited
-
mount(
Element? parent, Object? newSlot) → void -
Add this element to the tree in the given slot of the given parent.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyClients(
covariant Binder< T> oldWidget) → void -
Notifies all dependent elements that this inherited widget has changed, by
calling Element.didChangeDependencies.
override
-
notifyDependent(
covariant InheritedWidget oldWidget, Element dependent) → void -
Called by notifyClients for each dependent.
inherited
-
performRebuild(
) → void -
Calls the StatelessWidget.build method of the StatelessWidget object
(for stateless widgets) or the State.build method of the State object
(for stateful widgets) and then updates the widget tree.
inherited
-
ratio(
{double dividedBy = 1, double reducedByW = 0.0, double reducedByH = 0.0}) → double -
Available on BuildContext, provided by the ContextExt extension
Divide the height proportionally by the given value -
reassemble(
) → void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
rebuild(
{bool force = false}) → void -
Cause the widget to update itself. In debug builds, also verify various
invariants.
inherited
-
removeDependent(
Element dependent) → void -
Called by Element.deactivate to remove the provided
dependent
Element from this InheritedElement.inherited -
responsiveValue<
T> ({T? watch, T? mobile, T? tablet, T? desktop}) → T -
Available on BuildContext, provided by the ContextExt extension
Returns a specific value according to the screen size if the device width is higher than or equal to 1200 returndesktop
value. if the device width is higher than or equal to 600 and less than 1200 returntablet
value. if the device width is less than 300 returnwatch
value. in other cases returnmobile
value. -
setDependencies(
Element dependent, Object? value) → void -
Sets the value returned by getDependencies value for
dependent
.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 element.
inherited
-
unmount(
) → void -
Transition from the "inactive" to the "defunct" lifecycle state.
override
-
update(
covariant Binder< T> newWidget) → void -
Change the widget used to configure this element.
override
-
updateChild(
Element? child, Widget? newWidget, Object? newSlot) → Element? -
Update the given child with the given new configuration.
inherited
-
updateChildren(
List< Element> oldChildren, List<Widget> newWidgets, {Set<Element> ? forgottenChildren, List<Object?> ? slots}) → List<Element> -
Updates the children of this element to use new widgets.
inherited
-
updated(
covariant InheritedWidget oldWidget) → void -
Calls Element.didChangeDependencies of all dependent elements, if
InheritedWidget.updateShouldNotify returns true.
inherited
-
updateDependencies(
Element dependent, Object? aspect) → void -
Called by dependOnInheritedWidgetOfExactType when a new
dependent
is added.inherited -
updateSlot(
Object? newSlot) → void -
Called by updateSlotForChild when the framework needs to change the slot
that this Element occupies in its ancestor.
inherited
-
updateSlotForChild(
Element child, Object? newSlot) → void -
Change the slot that the given child occupies in its parent.
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 -
Wrapper around visitChildren for BuildContext.
inherited
-
visitChildren(
ElementVisitor visitor) → void -
Calls the argument for each child. Must be overridden by subclasses that
support having children.
inherited
-
widthTransformer(
{double dividedBy = 1, double reducedBy = 0.0}) → double -
Available on BuildContext, provided by the ContextExt extension
Gives you the power to get a portion of the width. Useful for responsive applications.
Operators
-
operator ==(
Object other) → bool -
Compare two widgets for equality.
inherited