FlutterBadge constructor

FlutterBadge({
  1. Key? key,
  2. required int itemCount,
  3. required Widget icon,
  4. bool hideZeroCount = true,
  5. Color badgeColor = Colors.red,
  6. Color badgeTextColor = Colors.white,
  7. double borderRadius = 0.0,
  8. BadgePosition? position,
  9. TextStyle? textStyle,
  10. EdgeInsets contentPadding = const EdgeInsets.all(5.0),
  11. 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);