smart_countdown 1.0.1 copy "smart_countdown: ^1.0.1" to clipboard
smart_countdown: ^1.0.1 copied to clipboard

A Flutter package for a customizable countdown timer to a specific end DateTime, refreshing every second.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    DateTime endDate = DateTime.now()
        .add(const Duration(days: 2, hours: 0, minutes: 0, seconds: 50));

    return Scaffold(
      appBar: AppBar(
        title: const Text("Countdown Timer Example"),
      ),
      body: Center(
        child: CountdownWidget(
          endDate,
          completedText: "Countdown Complete!",
          timerStyle: const TextStyle(fontSize: 18, color: Colors.red),
          timerColor: Colors.red,
          hideZeroValues: true,
        ),
      ),
    );
  }
}
5
likes
150
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for a customizable countdown timer to a specific end DateTime, refreshing every second.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on smart_countdown