Skip to content

hateshkumar/holdandload

Repository files navigation

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

video.mp4

1 2 3

About

The idea of this package is to create animated shooting button like Snapchat and Instagram.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published