cupertino_timer 0.1.0-dev
cupertino_timer: ^0.1.0-dev copied to clipboard

An iOS style countdown timer. Inspired by the native timer app on iOS.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:cupertino_timer/cupertino_timer.dart';

void main() {
  runApp(TimerApp());
}

class TimerApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'cupertino_timer',
      home: TimerHomePage(title: 'cupertino_timer'),
    );
  }
}

class TimerHomePage extends StatefulWidget {
  TimerHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _TimerHomePageState createState() => _TimerHomePageState();
}

class _TimerHomePageState extends State<TimerHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(
              margin: EdgeInsets.all(20),
              width: 200,
              height: 200,
              child: CupertinoTimer(
                duration: Duration(minutes: 1),
              ),
            ),
            Container(
              margin: EdgeInsets.all(20),
              width: 200,
              height: 200,
              child: CupertinoTimer(
                duration: Duration(minutes: 1),
                startOnInit: true,
                timeStyle: TextStyle(
                    fontFamily: 'Avenir Next', fontWeight: FontWeight.bold),
                ringColor: Colors.blue,
                ringStroke: 10,
              ),
            )
          ],
        ),
      ),
    );
  }
}
4
likes
100
pub points
62%
popularity

Publisher

verygoodtech.co

An iOS style countdown timer. Inspired by the native timer app on iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on cupertino_timer