Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting the Error when using the package Badge in Flutter

I have recently used the commands ‘flutter clean’ and then ‘flutter pub get’, before this the Badge package was working perfectly, but now after using these commands I am facing this error. Even though the package is properly imported. I guess this happened after the ‘flutter pub get’ when it resolved the dependencies.

Need help!

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Badge

enter image description here

>Solution :

Badge is coming from both flutter material and badge package. Flutter material provide by default.

In order to use the package one, you can do

import 'package:badges/badges.dart' as badge; 

You can call badge.Badge(....

If you like to hide the material Badges, you can do

import 'package:badges/badges.dart';
import 'package:flutter/material.dart' hide Badge;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading