duration_button 1.0.0 icon indicating copy to clipboard operation
duration_button: ^1.0.0 copied to clipboard

Create auto-click button likes Netflix`s Skip Intro button in Flutter!

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 #

PropsTypesDefaultDescription
durationDurationrequiredThe Duration value of the button.
widthdouble?nullThe width value of the button.
heightdouble?nullThe height value of the button.
childWidget?nullThe child widget of the button.
coverChildbool?falseThe bool value if cover covers child widget.
borderRadiusBorderRadiusnullThe border radius of the button.
onPressedVoidCallbackrequiredThe callback function that will be called when button is clicked. and if onCompleteis null, then onPressed will be called when completed.
onCompleteVoidCallback?nullThe callback function that will be called when the button is completly covered.
coverColorColor?Colors.black.withOpacity(0.2)the color value of the button.
backgroundColorColor?Theme Primary Colorthe color value of the button.
hoverColorColor?nullthe color value of the hover effect.
splashColorColor?nullthe color value of the splash effect.
splashFactoryInteractiveInkFeatureFactory?nullThe splashFactory value of the button.
borderBorder?nullThe 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.
7
likes
110
pub points
71%
popularity

Publisher

unverified uploader

Create auto-click button likes Netflix`s Skip Intro button in Flutter!

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on duration_button