seconds_countdown_timer 0.2.3 copy "seconds_countdown_timer: ^0.2.3" to clipboard
seconds_countdown_timer: ^0.2.3 copied to clipboard

package that provide countdown timer with customized widget.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SecondsCountdownTimer(
          endTime: 60, // Get static value from backend
          startDate: DateTime.now(), // Get static value from backend
          widgetBuilder: (context, time) {
            if (time == null) return const SizedBox.shrink();
            String hour =
                SecondsCountdownTimerUtils.getNumberAddZero(time.hours ?? 0);
            String min =
                SecondsCountdownTimerUtils.getNumberAddZero(time.min ?? 0);
            String sec =
                SecondsCountdownTimerUtils.getNumberAddZero(time.sec ?? 0);
            return Text("$hour : $min : $sec");
          },
        ),
      ),
    );
  }
}
5
likes
160
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

package that provide countdown timer with customized widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on seconds_countdown_timer