Flutter Countdown Timer milliseconde

import 'package:quiver/async.dart';



int _start = 10;
  int _current = 10;

void startTimer() {
    CountdownTimer countDownTimer = CountdownTimer(
      Duration(milliseconds: _start),
      const Duration(milliseconds: 1),
    );

    var sub = countDownTimer.listen(null);
    sub.onData((duration) {
      setState(() {
        int _current = _start - duration.elapsed.inSeconds;
        dureedefaut = _current;
      });
    });
  }

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top