wx_badge 2.0.0 copy "wx_badge: ^2.0.0" to clipboard
wx_badge: ^2.0.0 copied to clipboard

Customizable badge widget to show notifications, shopping cart items, and more with ease.

Pub Version GitHub GitHub GitHub

Customizable badge widget to show notifications, shopping cart items, and more with ease.

Preview

Demo

Usage #

To read more about classes and other references used by wx_badge, see the API Reference.

WxBadge(
  hidden: count == 0,
  position: WxBadgePosition.topRight,
  offset: const Offset(8, -8),
  style: WxBadgeStyle.circle(
    borderWidth: 2,
    borderStyle: BorderStyle.solid,
    borderColor: Theme.of(context).colorScheme.surface,
    backgroundColor: Colors.red,
    padding: const EdgeInsets.all(6),
  ),
  content: Text(
    count.toString(),
    key: ValueKey(count),
    style: const TextStyle(height: 1.15),
  ),
  transition: AnimatedSwitcherTransitions.zoomOut,
  child: const WxAvatar(
    image: NetworkImage('https://i.pravatar.cc/50?u=2'),
    elevation: 3.0,
    backgroundColor: Colors.red,
    child: Text('Wx'),
  ),
)

WxBadge(
  animated: true,
  position: WxBadgePosition.bottomRight,
  offset: const Offset(1, 1),
  style: WxBadgeStyle.circle(
    radius: 5,
    borderWidth: 2,
    borderStyle: BorderStyle.solid,
    borderColor: Theme.of(context).colorScheme.surface,
    backgroundColor: online ? Colors.green : Colors.red,
    padding: const EdgeInsets.symmetric(
      horizontal: 5,
      vertical: 2,
    ),
  ),
  child: const WxAvatar.circle(
    image: NetworkImage('https://i.pravatar.cc/50?u=20'),
    borderWidth: 2,
    borderAlign: 3,
    borderStyle: BorderStyle.solid,
    borderColor: Colors.blue,
    backgroundColor: Colors.red,
    child: Text('Wx'),
  ),
)

Sponsoring #

Buy Me A Coffee Ko-Fi

If this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.

4
likes
150
points
25
downloads

Publisher

verified publisherwidgetarian.com

Weekly Downloads

Customizable badge widget to show notifications, shopping cart items, and more with ease.

Repository (GitHub)

Topics

#ui #badge #animated #widgetarian

Documentation

API reference

Funding

Consider supporting this project:

buymeacoffee.com
ko-fi.com

License

BSD-3-Clause (license)

Dependencies

flutter, wx_box, wx_utils

More

Packages that depend on wx_badge