startProgress method
Starts an operation label that keeps rolling until the returned handle is completed, failed, or cancelled.
text is emitted immediately. frames can contain additional intermediate
labels, for example Exportaa, Exportee, and Exportii. Matching
glyphs stay fixed by default, so progress should animate only the
uncertain fragment of the word. When interval is omitted, frames tick
fast enough to keep the roll continuous. Set animateUnchanged to true for
decorative loops that intentionally re-roll identical glyphs.
Implementation
ReelTextProgress startProgress(
String text, {
List<String> frames = const <String>[],
ReelTextOptions? options,
Duration? interval,
bool animateUnchanged = false,
}) {
final sequence = frames.isEmpty
? <String>[text]
: frames.first == text
? List<String>.of(frames)
: <String>[text, ...frames];
final progressOptions = (options ?? const ReelTextOptions()).copyWith(
interrupt: false,
skipUnchanged: !animateUnchanged,
);
final tickInterval =
interval ??
Duration(
milliseconds: (progressOptions.duration.inMilliseconds * 0.55)
.round()
.clamp(80, 220)
.toInt(),
);
return _startFrameLoop(
initial: sequence.first,
frameAt: (tick) => sequence[tick % sequence.length],
interval: tickInterval,
options: progressOptions,
);
}