timer_button 0.0.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 29

Timer Button

A new Flutter package for timer button.

timer_button

A Button which will be enabled after specified time.

Usage

Set ButtonType for Button. There are 3 Type of button :

  • RaisedButton buttonType: ButtonType.RaisedButton (default)
  • FlatButton buttonType: ButtonType.FlatButton
  • OutlineButton buttonType: ButtonType.OutlineButton

Set text/lable label: "Try Again"

Set timeout in secounds timeOutInSeconds: 20

Set color color: Colors.deepPurple

Set disabled color disabledColor: Colors.red

Example

                new TimerButton(
                  label: "Send OTP Again",
                  timeOutInSeconds: 20,
                  onPressed: () {},
                  disabledColor: Colors.red,
                  color: Colors.deepPurple,
                  disabledTextStyle: new TextStyle(fontSize: 20.0),
                  activeTextStyle: new TextStyle(fontSize: 20.0, color: Colors.white),
                )

For issues and source code

[0.0.6]

  • Minor fixes.

[0.0.5]

  • Updated Example and Documents.

[0.0.4]

  • Minor fixes.

[0.0.3]

  • Updated Example and Documents.

[0.0.2]

  • Added Example

[0.0.1]

  • Initial.

example/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Timer Button Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  MyHomePageState createState() {
    return new MyHomePageState();
  }
}

class MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Timer Button Demo'),
      ),
      body: new Material(
        child: new Center(
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: new Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                new TimerButton(
                  label: "Send OTP Again",
                  timeOutInSeconds: 20,
                  onPressed: () {},
                  disabledColor: Colors.red,
                  color: Colors.deepPurple,
                  disabledTextStyle: new TextStyle(fontSize: 20.0),
                  activeTextStyle: new TextStyle(fontSize: 20.0, color: Colors.white),
                ),
                new TimerButton(
                  label: "Try Again",
                  timeOutInSeconds: 10,
                  onPressed: () {},
                  buttonType: ButtonType.OutlineButton,
                ),
                new TimerButton(
                  label: "CLOSE",
                  timeOutInSeconds: 5,
                  onPressed: () {},
                  buttonType: ButtonType.FlatButton,
                  disabledColor: Colors.deepOrange,
                  color: Colors.green,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  timer_button: ^0.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:timer_button/timer_button.dart';
  
Version Uploaded Documentation Archive
0.0.6 Aug 15, 2018 Go to the documentation of timer_button 0.0.6 Download timer_button 0.0.6 archive
0.0.5 Aug 15, 2018 Go to the documentation of timer_button 0.0.5 Download timer_button 0.0.5 archive
0.0.4 Aug 15, 2018 Go to the documentation of timer_button 0.0.4 Download timer_button 0.0.4 archive
0.0.3 Aug 14, 2018 Go to the documentation of timer_button 0.0.3 Download timer_button 0.0.3 archive
0.0.2 Aug 14, 2018 Go to the documentation of timer_button 0.0.2 Download timer_button 0.0.2 archive
0.0.1 Aug 14, 2018 Go to the documentation of timer_button 0.0.1 Download timer_button 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
29
Learn more about scoring.

We analyzed this package on Nov 15, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter packages pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0-dev.9.3.flutter-9c07fb64c4.
 
 Because timer_button depends on test >=0.12.0-beta.3 <1.3.0 which requires SDK version >=1.8.0 <2.0.0-∞, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0