Hookful<T> class

Hookful<T> gives the developer, the power of hooks to be used in a StatefulWidget.

The Hookful will attach itself to the State<StatefulWidget> and updates the widget whenever there is a change in value. The following is the implementation of a basic Hookful inside a State<StatefulWidget>.

...
late final Hookful<int> count;
@override
void initState() {
  count = Hookful(0, this);
  super.initState();
}
...

Unlike normal hooks, there is no void hooks() method to implement and hence you can initialise the hooks inside initState.

Constructors

Hookful(T value, State<StatefulWidget> statefulWidget)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statefulWidget State<StatefulWidget>
The Widget that should be rebuilt when the value changes.
getter/setter pair
value ↔ T
The getter that provides the current value of variable.
getter/setter pair

Methods

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

Operators

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