StateHolder class Null safety

StateHolder

StateHolder is A wrapper around InheritedWidget to make them easier to use and more reusable.

By using StateHolder instead of manually writing InheritedWidget, you get:

  • simplified allocation of resources
  • lazy-loading
  • a vastly reduced boilerplate over making a new class every time
  • friendly to devtools
  • increased scalability for classes with a listening mechanism that grows exponentially in complexity (such as ChangeNotifier, which is O(N) for dispatching notifications).

Properties

hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

of<T>(BuildContext context, [bool listen = false]) → T
Use This Method To Obtain The Nearest StateHolder