countdown_flutter 0.0.1 copy "countdown_flutter: ^0.0.1" to clipboard
countdown_flutter: ^0.0.1 copied to clipboard

outdated

A simple countdown plugin for flutter.

countdown #

A simple countdown plugin for flutter

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Usage #

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  var _done = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text(_done ? 'Finished!' : 'Counting...'),
        ),
        body: Center(
          child: Countdown(
            duration: Duration(seconds: 10),
            onFinish: () {
              setState(() {
                _done = true;
              });
            },
            builder: (BuildContext ctx, Duration remaining) => Text(
                  '${remaining.inMinutes}:${remaining.inSeconds}',
                  style: TextStyle(
                    fontSize: 30,
                  ),
                ),
          ),
        ),
      ),
    );
  }
}

47
likes
0
pub points
81%
popularity

Publisher

unverified uploader

A simple countdown plugin for flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on countdown_flutter