bottom_navigation_badge
BottomNavigationBadge एक Flutter विजेट है जिसे westdabestdb द्वारा विकसित किया गया है, जो डेवलपर्स को बॉटम नेविगेशन बार आइटम में सूचना बैज जोड़ने की अनुमति देता है।
westdabestdb/bottom_navigation_badge open-source repository details.
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
BottomNavigationBadge is a Flutter class developed by westdabestdb.
Add this to your package's pubspec.yaml file:
...
dependencies:
bottom_navigation_badge: ^1.0.3
Now in your Dart code, you can use:
import 'package:bottom_navigation_badge/bottom_navigation_badge.dart';
Initialize the badger. Isn't it a nice variable name lol 😁
BottomNavigationBadge badger = new BottomNavigationBadge(
backgroundColor: Colors.red,
badgeShape: BottomNavigationBadgeShape.circle,
textColor: Colors.white,
position: BottomNavigationBadgePosition.topRight,
textSize: 8);
Create a list of BottomNavigationBarItems
List<BottomNavigationBarItem> items = [
BottomNavigationBarItem(icon: Icon(Icons.home), title: Text("Home")),
BottomNavigationBarItem(icon: Icon(Icons.notifications), title: Text("Notifications")),
BottomNavigationBarItem(icon: Icon(Icons.face), title: Text("Profile"))
];
Add badge to index with content "1"
setState(() {
items = badger.setBadge(items, "1", index);
});
Remove the badge at index
setState(() {
items = badger.removeBadge(items, index);
});
Remove all the badges
setState(() {
items = badger.removeAll(items);
});
निर्भरता सूची 2 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗