PassTrait<T> class

The PassTrait Functionality allows you to pass data down your widget tree without struggles.

Inheritance

Constructors

PassTrait(T trait, {required Widget child})
The PassTrait Functionality allows you to pass data down your widget tree without struggles. Imagine having one unique value in your pack that special widgets below it regardless of their position or parent should know of. The PassTrait Widget injects your value in the Context, allowing you to access it everywhere.

Properties

child Widget
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trait → T
final

Methods

generate(Context context) Widget
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → dynamic
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

of<T>(Context c) → T
You can retrieve the value by using PassTrait.of. The values are passed by type, so you can just get one value per type(of course custom classes are also valid):