NodeInterface<R> class abstract

You can use this class to add loading and error states to your nodes

Signal<bool> isLoading

NullableSignal<Object> error

//A separate signal for full screen loading
Signal<bool> fullScreenLoading

//You can use the `loading` method to wrap any async operation
//so you don't have to handle the loading state yourself
Future<T> loading<T>(
   Future<T> future, {
   bool invokeLoading = true,
   //If you want to show a full screen loading, just set this to true
   bool fullScreen = false,
 })
Inheritance

Constructors

NodeInterface({Key? key})

Properties

error → NullableSignal<Object>
latefinal
fullScreenLoading → Signal<bool>
latefinal
hashCode → int
The hash code for this object.
no setterinherited
initialized → bool
no setterinherited
isLoading → Signal<bool>
latefinal
key → Key?
finalinherited
readable → dynamic
This is the readable version of the node It is used to access the signals of the node directly by its value.
no setterinherited
runtimeKey → Key
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(InheritedTrinityScope scope) → bool
Returns true if the node was previously initialized, false otherwise
inherited
clearError() → void
dispose() → void
Internal method called by the framework to clean up resources
inherited
findNode<N extends NodeInterface>() → N
inherited
findNodeOrNull<N extends NodeInterface>() → N?
inherited
isSignalRegistered(BaseSignal signal) → bool
We use this to improve optimization
inherited
loading<T>(Future<T> future(), {bool invokeLoading = true, bool fullScreen = false}) → Future<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose() → void
When the NodeProvider is disposed
inherited
onInit() → void
First point of entry for the node, the scope is already available
inherited
onReady() → void
After the first frame, the UI context is ready
inherited
registerSignal<S extends BaseSignal>(S signal) → S
inherited
toString() → String
A string representation of this object.
inherited
when<W extends Widget>({required W loading(), required W error(Object), required W orElse()}) → Widget

Operators

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

Static Methods

of<N extends NodeInterface>(BuildContext context) → N