Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Overview

Flutter Duration Button

Duration Button is auto-clicked button likes Netflix's Skip Intro button.

It provides normal duration button called DurationButton, icon based button called IconDurationButton, text based button called TextDurationButton and outlined button called TextDurationButton.

Simulator Screen Recording - iPhone 13 - 2022-01-24 at 23 12 17

Getting started

Depend on it.

$ flutter pub add duration_button

or

Add below line to your personal package's pubspec.yaml.

dependencies:
  duration_button: ^1.0.0

And run flutter pub get to install.

Import it.

import 'package:duration_button/duration_button.dart';

Use widget.

DurationButton(/* Props here.. */)
IconDurationButton(/* Props here.. */)
OutlinedDurationButton(/* Props here.. */)
TextDurationButton(/* Props here.. */)

Props

Props Types Default Description
duration Duration required The Duration value of the button.
width double? null The width value of the button.
height double? null The height value of the button.
child Widget? null The child widget of the button.
coverChild bool? false The bool value if cover covers child widget.
borderRadius BorderRadius null The border radius of the button.
onPressed VoidCallback required The callback function that will be called when button is clicked. and if onCompleteis null, then onPressed will be called when completed.
onComplete VoidCallback? null The callback function that will be called when the button is completly covered.
coverColor Color? Colors.black.withOpacity(0.2) the color value of the button.
backgroundColor Color? Theme Primary Color the color value of the button.
hoverColor Color? null the color value of the hover effect.
splashColor Color? null the color value of the splash effect.
splashFactory InteractiveInkFeatureFactory? null The splashFactory value of the button.
border Border? null The border value of the button

You can find other widget's Props from Documentation.

Example

DurationButton

DurationButton(
  duration: const Duration(seconds: 3),
  onPressed: () {},
  backgroundColor: Colors.yellow,
  splashFactory: NoSplash.splashFactory,
  onComplete: () => ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("onCompleteCalled!"))),
  child: const Text("Duration Button"),
),

IconDurationButton

IconDurationButton(
  Icons.favorite,
  size: 30,
  iconColor: Colors.pink,
  onPressed: () {},
  duration: const Duration(seconds: 2),
),

TextDurationButton

TextDurationButton(
  width: 150,
  height: 50
  duration: const Duration(seconds: 7),
  text: const Text('Text Duraion Button'),
  onPressed: () {},
),

OutlinedDurationButton

// String _skipIntro = 'Skip Intro';

OutlinedDurationButton(
  child: Text(_skipIntro),
  onPressed: () {},
  onComplete: () => setState(() => _skipIntro = 'Intro Skipped'),
  duration: const Duration(seconds: 3),
),

License

MIT License

Copyright (c) 2022 Kim Seung Hwan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

rounded_loading_button RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and

Jan 4, 2023

Simple flutter toggle button widge

Simple flutter toggle button widge

This is simple flutter toggle button widget. Supports show text labels and icons, Possible set multiple value to toggle ui, not only

Sep 27, 2022

A button with ripple effect while being hold

A button with ripple effect while being hold

ripple_button a button with ripple effect while being hold build requirements to run this project you need a working enviroment of flutter v2 or highe

Nov 8, 2021

May be used to intercept the Android back-button, as an alternative to `WillPopScope`.

back_button_interceptor In simple cases, when you need to intercept the Android back-button, you usually add WillPopScope to your widget tree. However

Dec 12, 2022

A custom dropdown button lets the user select from a number of items

A custom dropdown button lets the user select from a number of items

CircularDropDownMenu Description A custom dropdown button lets the user select from a number of items. The button shows the currently selected item as

Dec 5, 2020

A popup simple topModalSheet menu button widget with handsome design and easy to use

A popup simple topModalSheet menu button widget with handsome design and easy to use

top_modal_sheet A popup simple topModalSheet menu button widget with handsome design and easy to use. Installations Add top_modal_sheet: ^1.0.0 in you

Jul 29, 2022

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

async_button_builder AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect. It allows adding loading, disabl

Jul 10, 2022

AdvFAB - An Advanced floating action button that expands itself to reveal its hidden widget

AdvFAB (More Than Just A Floating Action Button) AdvFAB is An Advanced floating action button that expands itself to reveal its hidden widget. It can

Nov 4, 2022

A Flutter Widget that create a horizontal table with fixed column on left hand side.

A Flutter Widget that create a horizontal table with fixed column on left hand side.

horizontal_data_table A Flutter Widget that create a horizontal table with fixed column on left hand side. Installation This package is starting to su

Dec 27, 2022
Owner
Kim Seung Hwan
Kim Seung Hwan
Making-form - A form design with dart programming and auto next facility

Making-form - A form design with dart programming and auto next facility

Munem Sarker 3 Nov 15, 2022
Flutter Triple Status Button can use toggle button but in three statuses.

triple_status_button Triple Status Button. Flutter Triple Status Button can use toggle button but in three statuses. Property Description height heigh

MahdiBagjani 2 Nov 13, 2021
Flutter reaction button plugin it is fully customizable widget such as Facebook reaction button

Flutter Reaction Button Flutter button reaction it is fully customizable widget such as Facebook reaction button. Preview Demo Usage Include 'flutter_

Abdelouahed Medjoudja 174 Dec 19, 2022
A button that looks like a Cupertino text button

Cupertino Text Button A button that looks like a Cupertino text button! Text Button A simple text button can be created like this: CupertinoTextButton

Nick Sirovsky 0 Nov 24, 2022
A library to easily create radio button and checkbox groups.

Check/Radio Group A library to easily create radio button and checkbox groups. Define font size, selection color, position of radios / check and text

Caiubi Tech 2 Jan 6, 2021
A Widget that mimics the Facebook Reaction Button in Flutter.

ReactiveButton A Widget that mimics the Facebook Reaction Button in Flutter. Step by step explanation A full explanation on how to build such Widget m

Didier Boelens 47 Jul 12, 2022
Flutter base, with a navigation button

mysample A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

null 0 Dec 30, 2021
Flutter progress button

flutter_progress_button flutter_progress_button is a free and open source (MIT license) Material Flutter Button that supports variety of buttons style

Yang JIANG 91 Dec 6, 2022
Flutter Custom, Text, 3D, Social media button's package

Flutter Button flutter_button, which is a flutter package, contains animated, cool and awesome buttons. That you may like, thanks to this package you

Ismael Shakverdiev 15 Dec 29, 2022
This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

null 222 Nov 8, 2022