Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
setBadgeNum(int count, BuildContext context) async {
try {
await FlutterDynamicIcon.setApplicationIconBadgeNumber(count);
} on PlatformException {
print('Exception: Platform not supported');
} catch (e) {
// To get currently badge number that was set.
int badgeNumber = await FlutterDynamicIcon.getApplicationIconBadgeNumber();
// Quick alert box for acknowledgement
context: context,
title: 'Badge Number set as $badgeNumber',
text: 'Minimize the app to check it out!',
type: QuickAlertType.success,
confirmBtnColor: primaryColor,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment