I’ve problem that says badge isn’t a function and can’t read it. And the second issue says, "The name ‘Badge’ is defined in the libraries". can u help me guys?
Widget _buildIconNotified() {
return Badge(
badgeColor: AppColor.actionColor,
padding: EdgeInsets.all(3),
position: BadgePosition.topEnd(top: -7, end: 0),
badgeContent: Text('', style: TextStyle(color: Colors.white),
),
child: _buildIcon(),
);
}
i’ve tried to remove badges dependency from pubspec.lock. but nothing changed
2
Answers
I think the Badge widget is defined in more than one library. Material Library has a Badge widget and maybe you are also using some external pub package.
If you check the documentation of the package at https://pub.dev/packages/badges it says:
And then use it as
badges.Batch
, like this for example