HeartToggleProps constructor

const HeartToggleProps({
  1. bool isActive = false,
  2. Color activeFillColor = const Color(0xfffe8da5),
  3. Color activeStrokeColor = const Color(0xffe75776),
  4. Color passiveFillColor = Colors.white54,
  5. Color passiveStrokeColor = Colors.grey,
  6. double size = 40,
  7. double? strokeWidth,
  8. double ballElevation = 4.0,
  9. VoidCallback? onTap,
  10. ValueChanged<bool>? onChanged,
  11. Color ballColor = Colors.white,
  12. double? heartElevation,
  13. Color heartShadowColor = Colors.grey,
  14. Color ballShadowColor = Colors.grey,
  15. 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),
});