搜尋套件、儲存庫與 APP 分類

套件詳情v2.2.2

timer_count_down

簡單的倒數計時器。用於建立一個簡單計時器。純程式碼實現。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3.1萬
喜歡數
201
Pub 分數
150

安裝套件

flutter pub add timer_count_down

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個簡單的純 Dart 倒數計時器套件,專為建立基本計時器設計,設定簡單。支援包括 Android、iOS、Web、macOS、Windows 和 Linux 在內的多個平台。適用於需要簡單倒數功能且無需複雜依賴的應用程式。此套件輕量且易於整合,非常適合用於遊戲中的計時器、提醒或時間挑戰等情境。

適用情境

  • 在應用程式中創建簡單的倒數計時
  • 實施限時挑戰
  • 建構提醒或警報系統
  • 為教育類應用程式添加計時器
  • 使用遊戲機制
  • 顯示到期時間指示器

主要特色

  • 輕量級且純 Dart
  • 跨平台支援
  • 倒數計時的簡單 API
  • 無外部依賴
  • 與 Flutter 的輕鬆整合
  • 可設定的倒數計時持續時間

適合對象

  • 初學者 Flutter 開發者
  • 簡單的計時器實作
  • 需要基本倒計時邏輯的應用
  • 依賴最少的專案
  • 基於時間的 UI 元件

使用建議

  • 有限的高級功能
  • 不適合複雜的定時場景
  • 無內建的暫停/恢復功能
  • 需要手動處理回調
  • 僅適用於基本倒數計時需求
  • 超出基本設定的自訂

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Simple Count Down

pub

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

Preview

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!

所屬分類

原始碼儲存庫

使用此套件的專案