count_down_timer


A new Flutter countdown project that can be used to send SMS verification code scenarios


How to Use

# add this line to your dependencies
count_down_timer: ^0.0.6
import 'package:count_down_timer/count_down_timer.dart';

CountDownWidget(
        startSeconds: 6,
        onTapCallback: (timer) {
          print('onTapCallback:current is ${timer.tick}s');
        },
        language: CountDown.EN,
        verifyStr: "Send",
        enableTS: TextStyle(color: const Color(0xff000000)),
        disableTS: TextStyle(color: const Color(0xff999999)),
      )

API

propertydescriptiondefaultValue
startSecondsint60
onTapCallbackFunction (timer)
enableTSTextStyle : clickable TextStyleTextStyle(color: const Color(0xff000000))
disableTSTextStyle : unclickable TextStyleTextStyle(fontSize: 16, color: const Color(0xff999999))
verifyStrString
languageCountDown.EN or CountDown.ZH

GitHub

Libraries

count_down_timer