FLUTTER ECOSYSTEM

DizoftTeam/simple_count_down

Flutter 的簡單倒數計時(計時器)

simple_count_down 專案封面
Stars
60
Forks
24
最近推送(UTC)
2023年8月5日
專案狀態
未封存
Dizoft Team GitHub avatar
GITHUB Organization

Dizoft Team ↗

語言DartSwiftKotlinObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • lint開發依賴^1.3.0
  • pedantic開發依賴^1.9.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Simple Count Down

pub https://badges.fyi/github/latest-tag/DizoftTeam/simple_count_down https://badges.fyi/github/stars/DizoftTeam/simple_count_down https://badges.fyi/github/license/DizoftTeam/simple_count_down

A highly customizable countdown widget for Flutter, with support for custom styling, intervals, and onFinished callbacks.

Preview

https://raw.githubusercontent.com/DizoftTeam/simple_count_down/master/assets/preview.gif

Installing

  • Add the latest version of the package to your pubspec.yaml file in the dependency section.
  dependencies:
    flutter:
      sdk: flutter

    timer_count_down: ^2.2.2

Run this in your terminal or click on pub get

$ flutter pub get

How to use

Simple example for the usage of the package is shown below.

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Countdown(
      seconds: 20,
      build: (BuildContext context, double time) => Text(time.toString()),
      interval: Duration(milliseconds: 100),
      onFinished: () {
        print('Timer is done!');
      },
    );
  }
}

Example

For pause, restart and resume you need to use CountdownController. For an example of using the package, please check the example folder. Otherwise, keep reading and keep going!