timer_snackbar 0.0.2 copy "timer_snackbar: ^0.0.2" to clipboard
timer_snackbar: ^0.0.2 copied to clipboard

A new Flutter package that helps developers to add a beautiful live timer at snackbar to their Flutter app.

Timer Snackbar #

Timer Snackbar package let you to add a beautiful live timer at snackbar to your Flutter app.

Installation #

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  timer_snackbar: ^0.0.2
  1. Import the package and use it in your Flutter App.
import 'package:timer_snackbar/timer_snackbar.dart';

Preview #

Preview



Example #

There are a number of properties that you can modify:

  • context
  • contentText
  • iconPath
  • afterExecuteMethod
  • second
  • backgroundColor
  • contentTextStyle

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Timer Snackbar"),
      ),
      body: Builder(
        builder: (context) {
          return Center(
            child: ElevatedButton(
              child: const Padding(
                  padding: EdgeInsets.all(8.0),
                  child: Text('Show Snackbar', textScaleFactor: 1.2)),
              style: ElevatedButton.styleFrom(
                  shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(8.0))),
              onPressed: () => timerSnackbar(
                context: context,
                contentText: "A snackbar with live timer.",
                iconPath: 'assets/undo.png',
                afterExecuteMethod: () => print("Operation Execute."),
                second: 5, // default value 4 second
              ),
            ),
          );
        },
      ),
    );
  }
}
25
likes
140
points
74
downloads

Publisher

verified publisheralgoramming.com

Weekly Downloads

A new Flutter package that helps developers to add a beautiful live timer at snackbar to their Flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on timer_snackbar