All Projects β†’ federicodesia β†’ custom_timer

federicodesia / custom_timer

Licence: MIT License
A Flutter package to create a customizable timer.

Programming Languages

dart
5743 projects
swift
15916 projects

Projects that are alternatives of or similar to custom timer

gen lang
gen_lang is a dart library for internationalization. Extracts messages to generate dart files required by Intl, inspired by Intl_translation and Flutter i18n
Stars: ✭ 94 (+276%)
Mutual labels:  flutter-plugins, flutter-package
stop watch timer
This is Stop Watch Timer for flutter plugin.πŸƒβ€β™‚οΈ
Stars: ✭ 76 (+204%)
Mutual labels:  timer, flutter-package
progressive image
A flutter widget that progressively loads large images using Low-Quality Image Placeholders.
Stars: ✭ 28 (+12%)
Mutual labels:  flutter-plugins, flutter-package
lang table
lang_table is a dart plugin to generate string files from a source. Use a table to manage all multi-language resources. Inspired by fetch-mobile-localization-from-airtable
Stars: ✭ 17 (-32%)
Mutual labels:  flutter-plugins, flutter-package
glider
Server-side rendering for mobile apps, powered by Flutter
Stars: ✭ 20 (-20%)
Mutual labels:  flutter-package
timerlab
⏰ A simple and customizable timer
Stars: ✭ 94 (+276%)
Mutual labels:  timer
tm
timers and timeline
Stars: ✭ 31 (+24%)
Mutual labels:  timer
water drop nav bar
flutter navigation bar with water drop effect.
Stars: ✭ 29 (+16%)
Mutual labels:  flutter-package
flutter country picker
A flutter package to select a country from a list of countries.
Stars: ✭ 43 (+72%)
Mutual labels:  flutter-package
injector io
InjectorIO - Dependency Injection for Flutter
Stars: ✭ 73 (+192%)
Mutual labels:  flutter-package
Flutter-firestore-auth
Flutter mobile app with firestore authentication including Email and Social auth.
Stars: ✭ 95 (+280%)
Mutual labels:  flutter-package
redtimer
RedTimer - Redmine Time Tracker
Stars: ✭ 59 (+136%)
Mutual labels:  timer
advpl-MsgTimer
Função AdvPL de mensagens (Alert, Info, Stop, Success, YesNo e NoYes) com Timer para fechamento automÑtico
Stars: ✭ 17 (-32%)
Mutual labels:  timer
gnome-shell-teatime
No description or website provided.
Stars: ✭ 34 (+36%)
Mutual labels:  timer
emoji picker
A Flutter package that provides an Emoji Keyboard widget
Stars: ✭ 82 (+228%)
Mutual labels:  flutter-package
flipdown-timer-card
Flipdown Timer Card for Home Assistant Lovelace
Stars: ✭ 28 (+12%)
Mutual labels:  timer
time chart
A scrollable time chart in Flutter.
Stars: ✭ 21 (-16%)
Mutual labels:  flutter-package
sliding clipped nav bar
Bottom navigation bar with sliding clip effect.
Stars: ✭ 46 (+84%)
Mutual labels:  flutter-package
libmcu
A toolkit for firmware development
Stars: ✭ 33 (+32%)
Mutual labels:  timer
eva icons flutter
Flutter package for Eva Icons. Eva Icons is a pack of more than 480 beautifully crafted Open Source icons for common actions and items. https://pub.dartlang.org/packages/eva_icons_flutter
Stars: ✭ 80 (+220%)
Mutual labels:  flutter-package

Custom Timer βŒ›

A Flutter package to create a customizable timer.


πŸŽ‰ Features

  • Timer controller.
  • Auto count up / down timer.
  • Custom builders.

πŸ“Œ Simple Usage


example1


final CustomTimerController _controller = CustomTimerController();
CustomTimer(
  controller: _controller,
  begin: Duration(days: 1),
  end: Duration(),
  builder: (time) {
    return Text(
      "${time.hours}:${time.minutes}:${time.seconds}.${time.milliseconds}",
      style: TextStyle(fontSize: 24.0)
    );
  }
)

Now you can use the controller methods start(), pause() and reset(). You can also add listeners to state changes or just use the state property when you need it.


πŸ“Œ Using StateBuilder and AnimationBuilder


example2


CustomTimer(
  controller: _controller,
  begin: Duration(days: 1),
  end: Duration(),
  builder: (time) {
    return Text(
      "${time.hours}:${time.minutes}:${time.seconds}.${time.milliseconds}",
      style: TextStyle(fontSize: 24.0)
    );
  },
  stateBuilder: (time, state) {
    // This builder is shown when the state is different from "couting".
    if(state == CustomTimerState.paused) return Text(
      "The timer is paused",
      style: TextStyle(fontSize: 24.0)
    );

    // If null is returned, "builder" is displayed.
    return null;
  },
  animationBuilder: (child) {
    // You can define your own state change animations.
    // Remember to return the child widget of the builder.
    return AnimatedSwitcher(
      duration: Duration(milliseconds: 250),
      child: child,
    );
  },
  onChangeState: (state){
    // This callback function runs when the timer state changes.
    print("Current state: $state");
  }
)

πŸ”§ Installation

Add this to your package's pubspec.yaml file:

dependencies:
  custom_timer: ^0.1.1

Install it:

$ flutter pub get

Import the package in your project:

import 'package:custom_timer/custom_timer.dart';

πŸ™‡ Author


Hi there πŸ‘‹ This package is in development so if you find a bug or have a suggestion please let me know so we can improve it! πŸ˜ƒ If you want to motivate me to continue, you can give me a cup of coffee β˜• and I will get a lot of energy out of it.


Buy Me A Coffee
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].