flutter_new_badger 1.0.1 copy "flutter_new_badger: ^1.0.1" to clipboard
flutter_new_badger: ^1.0.1 copied to clipboard

A flutter project to handle app icon badges for iOS, macOS and android

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_new_badger/flutter_new_badger.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    init();
  }

  void init() async {
    await FlutterNewBadger.setBadge(6);
    print('Badge set');
    await FlutterNewBadger.removeBadge();
    print('Badge removed');
  }


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('New badger plugin'),
        ),
      ),
    );
  }
}
3
likes
0
points
6.1k
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter project to handle app icon badges for iOS, macOS and android

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_new_badger