Skip to content
On this page

Badge

A small status or count indicator attached to content.

Badge in FluttyUIBadge in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Badge

const Badge({
  super.key,
  this.child,
  this.type = BadgeType.dot,
  this.size,
  this.position = BadgePosition.topRight,
  this.count,
  this.label,
  this.icon,
  this.maxCount = 99,
  this.showZero = false,
  this.color,
  this.foregroundColor,
  this.borderColor,
  this.dotBorderWidth,
  this.overlap = 0,
});
ParameterTypeRequiredDefault
keyKey?Nonull
childWidget?Nonull
typeBadgeTypeNoBadgeType.dot
sizeBadgeSize?Nonull
positionBadgePositionNoBadgePosition.topRight
countint?Nonull
labelString?Nonull
iconWidget?Nonull
maxCountintNo99
showZeroboolNofalse
colorColor?Nonull
foregroundColorColor?Nonull
borderColorColor?Nonull
dotBorderWidthdouble?Nonull
overlapdoubleNo0

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/data_display/badge/badge.dart

This reference is generated from the Badge declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI