Flutter version 3.1.0

Description

The idea of this package is to create holding animated buttons like Snapchat and Instagram shows while recording reels or stories.

Getting started

Wrap HoldAndLoad Widget with Scaffold

 HoldAndLoad(
child:Text('hold'),
controller: ShootingController(ShootingValue(false, false)),
isShootingButtonAnimate: false,
style: HoldNLoadStyle,
callBackShootingEnd: callBackEnd,
callBackShootingStart: callBackStart,
listener:listener,
);

HoldAndLoad Style

Style can be with gradient or background


with gradient

Style.withGradientColor(
outerSize: const Size.square(115),
innerSize: const Size.square(82),
outerColor: Colors.white,
progressColor: Colors.redAccent,
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFF00AACE),
Color(0xFF006BCE),
],
),
progressWidth: 3,
outerWidth: 4)


with background

Style.withBackgroundColor(
outerSize: const Size.square(115),
innerSize: const Size.square(82),
outerColor: Colors.white,
progressColor: Colors.redAccent,
backgroundColor: const Color(0xFF00AACE),
progressWidth: 3,
outerWidth: 4)

CallBack

callBackShootingStart:

callBackShootingStart will get triggered as soon as the HoldAndLoad longPress gesture detcted, it will only triggered one time.

callBackShootingEnd:

callBackShootingEnd will get triggered as soon as the HoldAndLoad longPress released, it will only triggered one time.

listener:

listener will get triggered from the start of callBackShootingStart till callBackShootingEnd triggered.

DEMO

https://user-images.githubusercontent.com/18635520/188449124-0863c9be-1701-4004-9699-940159773b3e.mov

1 2 3

Libraries

holdnload