withBadge method
Implementation
Widget withBadge({
Widget? badge,
Alignment alignment = Alignment.topRight,
double? width = 8,
double? height = 8,
}) => Stack(
clipBehavior: Clip.none,
children: [
this,
Positioned(
top: 0,
right: 0,
child:
badge ??
Container(
width: width,
height: height,
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
),
),
],
);