Skip to content

Commit

Permalink
Added showBadge
Browse files Browse the repository at this point in the history
Added showBadge
  • Loading branch information
malikdoksoz committed Apr 19, 2022
1 parent fcf8b0c commit cb71c88
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/src/chip_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class DefaultChipBuilder extends ChipBuilder {

/// Color of the badge chip.
final Color badgeColor;


/// show/hide badge
final bool showBadge;

/// Padding for badge.
final EdgeInsets padding;

Expand All @@ -44,6 +47,7 @@ class DefaultChipBuilder extends ChipBuilder {
this.chips, {
required this.textColor,
required this.badgeColor,
required this.showBadge,
required this.padding,
required this.margin,
required this.borderRadius,
Expand All @@ -57,7 +61,10 @@ class DefaultChipBuilder extends ChipBuilder {
}
return Stack(
alignment: Alignment.center,
children: <Widget>[child, asBadge(chip)],
children: <Widget>[
child,
showBadge ? asBadge(chip) : const SizedBox.shrink()
],
);
}

Expand Down

0 comments on commit cb71c88

Please sign in to comment.