FlutterBadge constructor
FlutterBadge({
- Key? key,
- required int itemCount,
- required Widget icon,
- bool hideZeroCount = true,
- Color badgeColor = Colors.red,
- Color badgeTextColor = Colors.white,
- double borderRadius = 0.0,
- BadgePosition? position,
- TextStyle? textStyle,
- EdgeInsets contentPadding = const EdgeInsets.all(5.0),
- double textSize = 12.0,
Constructor
key
is optional, default - true
itemCount
,icon
and position
are required fields
hideZeroCount
is optional, default - true
badgeColor
is optional, default - red
badgeTextColor
is optional, default - white
borderRadius
is optional, default - 0.0
textStyle
is optional, default - null
textSize
is optional, default - 12.0
contentPadding
is optional, default - 5.0 for all sides
Implementation
FlutterBadge({
Key? key,
required this.itemCount,
required this.icon,
this.hideZeroCount: true,
this.badgeColor = Colors.red,
this.badgeTextColor: Colors.white,
this.borderRadius = 0.0,
this.position,
this.textStyle,
this.contentPadding = const EdgeInsets.all(5.0),
this.textSize = 12.0,
}) : assert(itemCount >= 0),
super(key: key);