HeartToggleProps constructor
- bool isActive = false,
- Color activeFillColor = const Color(0xfffe8da5),
- Color activeStrokeColor = const Color(0xffe75776),
- Color passiveFillColor = Colors.white54,
- Color passiveStrokeColor = Colors.grey,
- double size = 40,
- double? strokeWidth,
- double ballElevation = 4.0,
- VoidCallback? onTap,
- ValueChanged<
bool> ? onChanged, - Color ballColor = Colors.white,
- double? heartElevation,
- Color heartShadowColor = Colors.grey,
- Color ballShadowColor = Colors.grey,
- Duration duration = const Duration(milliseconds: 300),
Properties of the heart toggle widget with their default values and description.
isActive
: Whether the heart is active or not.
onTap
: null : Function to be called when the heart is toggled.
activeFillColor
: const Color(0xfffe8da5) : Color of the heart when it is active.
activeStrokeColor
: const Color(0xffe75776) : Color of the stroke when the heart is active.
passiveFillColor
: Colors.white54 : Color of the heart when it is inactive.
passiveStrokeColor
: Colors.grey : Color of the stroke when the heart is inactive.
size
: 40.0 : Size of the heart.
strokeWidth
: 2.0 : Width of the stroke. (40 / 20)
ballElevation
: 4.0 : Elevation of the ball.
ballColor
: Colors.white : Color of the ball.
heartElevation
: null : Elevation of the heart.
heartShadowColor
: Colors.grey : Color of the shadow of the heart.
ballShadowColor
: Colors.grey : Color of the shadow of the ball.
duration
: const Duration(milliseconds: 300) : Duration of the animation.
onChanged
: Function to be called when the heart is toggled. This function is called with a bool parameter.
Implementation
const HeartToggleProps({
this.isActive = false,
this.activeFillColor = const Color(0xfffe8da5),
this.activeStrokeColor = const Color(0xffe75776),
this.passiveFillColor = Colors.white54,
this.passiveStrokeColor = Colors.grey,
this.size = 40,
this.strokeWidth,
this.ballElevation = 4.0,
this.onTap,
this.onChanged,
this.ballColor = Colors.white,
this.heartElevation,
this.heartShadowColor = Colors.grey,
this.ballShadowColor = Colors.grey,
this.duration = const Duration(milliseconds: 300),
});