icon_badge 1.0.0 copy "icon_badge: ^1.0.0" to clipboard
icon_badge: ^1.0.0 copied to clipboard

A simple flutter icon widget with notification badge to show number of items.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:icon_badge/icon_badge.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: TestApp(),
    );
  }
}

class TestApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Test App'),
        actions: <Widget>[
          IconBadge(
            icon: Icon(Icons.notifications_none),
            itemCount: 100,
            badgeColor: Colors.red,
            itemColor: Colors.white,
            maxCount: 99,
            hideZero: true,
            onTap: () {
              print('test');
            },
          ),
        ],
      ),
      body: Center(
        child: Text('Icon badge test'),
      ),
    );
  }
}
32
likes
150
pub points
91%
popularity

Publisher

unverified uploader

A simple flutter icon widget with notification badge to show number of items.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on icon_badge