FLUTTER ECOSYSTEM

AndresR173/countdown_progress_indicator

可自訂的 Flutter 計時器

倒數進度指示器 專案封面
Stars
13
Forks
8
最近推送(UTC)
2024年7月14日
專案狀態
未封存
Andres Rojas GitHub avatar
GITHUB User

Andres Rojas ↗

iOS developer, Open Source lover

Medellín, Colombia官方網站 ↗
語言DartSwiftKotlinObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^4.0.0

原始 README

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

展開 / 收合專案 README

Countdown Progress Indicator

https://badges.fyi/github/latest-tag/AndresR173/countdown_progress_indicator https://badges.fyi/github/stars/AndresR173/countdown_progress_indicator https://badges.fyi/github/license/AndresR173/countdown_progress_indicator

Customizable countdown timer for Flutter

Getting Started

To use this package, add countdown_progress_indicador as a dependency in your pubspec.yaml file.

dependencies:
	...
	countdown_progress_indicador: ^0.1.3

How to use

In your project add the following import:

import  'package:countdown_progress_indicator/countdown_progress_indicator.dart';

This widget starts the countdown automatically by default and supports pause and resume actions. If you want to support these actions, implement a CountdownController as the example above:

SizedBox(
	height:  200,
	width:  200,
	child:  CountDownProgressIndicator(
		controller: _controller,
		valueColor:  Colors.red,
		backgroundColor:  Colors.blue,
		initialPosition:  0,
		duration:  20,
		text:  'SEC',
		onComplete: () =>  null,
	),
),

Custom Formatter

If you want to show a text different than the time in seconds, you can implement a custom time formatter.

CountDownProgressIndicator(
	controller: _controller,
	valueColor: Colors.red,
	backgroundColor: Colors.blue,
	initialPosition: 0,
	duration: 365,
	timeFormatter: (seconds) {
		return Duration(seconds: seconds)
			.toString()
			.split('.')[0]
			.padLeft(8, '0');
	},
	text: 'hh:mm:ss',
	onComplete: () => null,
),

Countdown

countdown