Coder Social home page Coder Social logo

runo22 / timer_snackbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sabikrahat/timer_snackbar

0.0 0.0 0.0 592 KB

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

Home Page: https://pub.dev/packages/timer_snackbar

License: Other

Java 0.29% Swift 2.38% Objective-C 0.08% Dart 12.25% CMake 31.22% C++ 42.93% C 2.93% HTML 7.92%

timer_snackbar's Introduction

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
              ),
            ),
          );
        },
      ),
    );
  }
}

timer_snackbar's People

Contributors

sabikrahat avatar runo22 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.