heart_toggle 0.0.3
heart_toggle: ^0.0.3 copied to clipboard
A Flutter package with a heart shapped toggle. Inspired from a react component and dribble.
heart_toggle #
A Flutter package for heart shapped toggle.
Getting Started #
-
First add heart_toggle package to your pubspec dependencies.
-
To import heart_toggle:
import 'package:heart_toggle/heart_toggle.dart'; -
To use:
HeartToggle( props: HeartToggleProps( size: 40.0, passiveFillColor: Colors.grey[200]!, ballElevation: 4.0, heartElevation: 4.0, ballColor: Colors.white, onChanged: (toggled) => {}, ), )
Properties and Default Values #
isActive:falseactiveFillColor:0xfffe8da5(Pink, kind of)activeStrokeColor:0xffe75776(Dark pink, probably)passiveFillColor:Colors.white54passiveStrokeColor:Colors.greysize:40( 40 is taken as the height and 40 x 1.5 is width)strokeWidth:'size' / 20(Eg: 40/20 = 2)onTap:nullonChanged:nullballColor:Colors.whiteheartElevation:nullheartShadowColor:Colors.grey(only applicable when 'heartElevation' is not null)ballElevation:4.0,ballShadowColor:Colors.greyduration:const Duration(milliseconds: 300)