Screenshot (Null safe)

If you also want to handle onTap with some splash, use this widget, you can further customize it according to your needs:
You don't need to depend on a package, just copy this class:
class NamedIcon extends StatelessWidget {
final IconData iconData;
final String text;
final VoidCallback? onTap;
final int notificationCount;
const NamedIcon({
Key? key,
this.onTap,
required this.text,
required this.iconData,
this.notificationCount = 0,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
width: 72,
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Stack(
alignment: Alignment.center,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(iconData),
Text(text, overflow: TextOverflow.ellipsis),
],
),
Positioned(
top: 0,
right: 0,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.red),
alignment: Alignment.center,
child: Text('$notificationCount'),
),
)
],
),
),
);
}
}
Usage:
Scaffold(
appBar: AppBar(
title: Text('AppBar'),
actions: [
NamedIcon(
text: 'Inbox',
iconData: Icons.notifications,
notificationCount: 11,
onTap: () {},
),
NamedIcon(
text: 'Mails',
iconData: Icons.mail,
notificationCount: 1,
onTap: () {},
),
],
),
)