ChicoOnce class

Runs an action at most once until reset.

final once = ChicoOnce();
onPressed: () => once.run(() => openPaywall());

For named app-wide gates, use ChicoOnceKey.

Constructors

ChicoOnce()
Creates a one-shot gate.

Properties

done → bool
Whether run has already fired.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Allows run again.
run(void action()) → void
Runs action only the first time.
toString() → String
A string representation of this object.
inherited

Operators

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