Fluxy
Feedback & Overlays

FxBadge

A highly customizable notification overlay for any widget.

FxBadge

FxBadge wraps any widget with a notification dot, count, or custom label. It is fully layout-aware and respects structural constraints.

Usage

FxBadge(
  label: "New",
  color: Colors.red,
  child: Icon(Icons.notifications),
)

Features

Layout-Aware

As of v0.1.6, FxBadge respects Structural Recursion. When placed inside complex layouts, it correctly calculates its constraints.

Custom Positioning

Control the exact location of the badge using offset.

FxBadge(
  label: "5",
  offset: Offset(10, -5), // Fine-tune position
  child: MyIcon(),
)

API Reference

NameTypeDefaultDescription
childWidgetrequiredThe widget to badge.
labelStringrequiredThe text content of the badge.
colorColorprimaryBackground color of the badge.
textColorColorwhiteText color of the badge.
offsetOffsetOffset.zeroPositional offset from the top-right corner.
styleFxStyle?nullCustom atomic style for the badge container.
responsiveFxResponsiveStyle?nullResponsive style overrides.

Custom Content

Instead of a simple label, you can pass a full Widget as content.

FxBadge(
  content: Icon(Icons.star, size: 10),
  child: MyAvatar(),
)

On this page