Create Flutter Package and Publish to Dart packages : Timer Button

I just started on working on new project and it led me copy paste the code from previous project for timer button .So I developed this package so we all can use this :)
Timer Button
  1. Create a new flutter project and select Flutter Package:
New Flutter Package

2. Add your code in

lib/timer_button.dart

3. Update pubspec.yaml

pubspec.yaml

4. Publishing packages

Prior to publishing, make sure to review the pubspec.yaml, README.md, and CHANGELOG.md files to make sure their content is complete and correct.

Next, run the dry-run command to see if everything passes analysis:

flutter packages pub publish --dry-run

Finally, run the actual publish command:

flutter packages pub publish

For details on publishing, see the Pub publishing docs.

Timer Button

Use this package as a library

open timer_button and select installing tab and follow the steps

Timer Button

The Code :

new TimerButton(
label: "Send OTP Again",
timeOutInSeconds: 3,
onPressed: () {},
color: Colors.deepPurple,
),
new TimerButton(
label: "Try Again",
timeOutInSeconds: 4,
onPressed: () {},
buttonType: ButtonType.OutlineButton,
),
new TimerButton(
label: "CLOSE",
timeOutInSeconds: 5,
onPressed: () {},
buttonType: ButtonType.FlatButton,
disabledColor: Colors.deepOrange,
color: Colors.green,
),

The Result :

Demo Screenshot
Like what you read? Give Ajay Kumar a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.