DelayBlock class
Helps to block part of code for minimum-given time.
Just wrap code with start and finish.
If code runs fast, then finish is awaited for rest of duration.
If code runs too slowly, then finish is triggered immediately.
Constructors
- DelayBlock(Duration duration, [bool startNow = true])
-
Default constructor
durationof delay block.startNowimmediately in constructor.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
finish(
) → Future< void> -
awaits delay finish.
If code runs fast, then finish is awaited for rest of
duration. If code runs too slowly, then finish is triggered immediately. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → void - Sets start timestamp. Can be called multiple times - timestamp is updated and delay postponed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited