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.

example/lib/main.dart

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

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  var _done = false;
  @override
  void initState() {
    super.initState();
  }

  @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
79%
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