timer_count_down 1.0.2 copy "timer_count_down: ^1.0.2" to clipboard
timer_count_down: ^1.0.2 copied to clipboard

outdated

Simple CountDown timer. Using for create a simple timer. It's pure all

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Countdown'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Countdown(
          seconds: 20,
          build: (_, double time) => Text(time.toString()),
          interval: Duration(milliseconds: 100),
          onFinished: () {
            print('Timer is done!');
          },
        ),
      ),
    );
  }
}
188
likes
0
pub points
98%
popularity

Publisher

verified publisherdizoft.ru

Simple CountDown timer. Using for create a simple timer. It's pure all

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on timer_count_down