IconButton(
onPressed: () {
Navigator.pushNamed(context, Routes.notification);
},
icon: ImageIcon(
Notification == null ? AssetImage("../../images/Icons/bell.png") : AssetImage("../../images/Icons/bin.png"),
size: 21,
),
),
What i wanted is to change the icon whenever any specific widget contains 0 children
My Idea is to change the notification icon when we have zero notification and use another icon when notification widget have same children or have some notification
CodePudding user response:
Check out this flutter package
now just add items to your List in StatefulWidget
by setState and do what you like, if you need IconButton
just pass it in child of your Badge,
read badges doc to fix badgeContent, good luck