start method

  1. @override
Future<void> start()
override

Implementation

@override
Future<void> start() async {
  isLoading = true;
  int progress = 0;

  Timer.periodic(speed!, (timer) {
    if (!isLoading) {
      timer.cancel();
    } else {
      final filled = '=' * (progress % (barWidth + 1));
      final empty = ' ' * (barWidth - (progress % (barWidth + 1)));
      final bar = '[$filled$empty]';
      stdout.write('\r${formatOutput(bar)}');
      progress++;
    }
  });
}