Badge constructor

const Badge({
  1. Key? key,
  2. Widget? badgeContent,
  3. Widget? child,
  4. Color badgeColor = Colors.red,
  5. double elevation = 2,
  6. bool toAnimate = true,
  7. BadgePosition? position,
  8. BadgeShape shape = BadgeShape.circle,
  9. EdgeInsetsGeometry padding = const EdgeInsets.all(5.0),
  10. Duration animationDuration = const Duration(milliseconds: 500),
  11. BorderRadiusGeometry borderRadius = BorderRadius.zero,
  12. AlignmentGeometry alignment = Alignment.center,
  13. BadgeAnimationType animationType = BadgeAnimationType.slide,
  14. bool showBadge = true,
  15. bool ignorePointer = false,
  16. BorderSide borderSide = BorderSide.none,
  17. StackFit stackFit = StackFit.loose,
  18. Gradient? gradient,
})

Creates a Badge.

If child is null, it doesn't make sense to set ignorePointer, position and alignment

See also:

Implementation

const Badge({
  Key? key,
  this.badgeContent,
  this.child,
  this.badgeColor = Colors.red,
  this.elevation = 2,
  this.toAnimate = true,
  this.position,
  this.shape = BadgeShape.circle,
  this.padding = const EdgeInsets.all(5.0),
  this.animationDuration = const Duration(milliseconds: 500),
  this.borderRadius = BorderRadius.zero,
  this.alignment = Alignment.center,
  this.animationType = BadgeAnimationType.slide,
  this.showBadge = true,
  this.ignorePointer = false,
  this.borderSide = BorderSide.none,
  this.stackFit = StackFit.loose,
  this.gradient,
}) : super(key: key);