Badge constructor
const
Badge({
- Key? key,
- Widget? badgeContent,
- Widget? child,
- Color badgeColor = Colors.red,
- double elevation = 2,
- bool toAnimate = true,
- BadgePosition? position,
- BadgeShape shape = BadgeShape.circle,
- EdgeInsetsGeometry padding = const EdgeInsets.all(5.0),
- Duration animationDuration = const Duration(milliseconds: 500),
- BorderRadiusGeometry borderRadius = BorderRadius.zero,
- AlignmentGeometry alignment = Alignment.center,
- BadgeAnimationType animationType = BadgeAnimationType.slide,
- bool showBadge = true,
- bool ignorePointer = false,
- BorderSide borderSide = BorderSide.none,
- StackFit stackFit = StackFit.loose,
- 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);