FeatureToggle class
A toggle class to check if a feature is enabled.
Constructors
- FeatureToggle({int requiredTaps = 5, Duration coolOff = const Duration(seconds: 1)})
-
Creates a toggle class that can be increased by registerTap
If users register requiredTaps registerTap will return
true
Between taps there may only be coolOff Duration after which the count goes back to 0
Properties
- coolOff → Duration
-
The duration that is allowed during each tap
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- requiredTaps → int
-
The number of taps required to enable a feature
final
- 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
-
registerTap(
) → bool - Registers a new tap. Returns true or false depending on if the taps are >= requiredTaps
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited