flutter_app_badge 2.0.2 copy "flutter_app_badge: ^2.0.2" to clipboard
flutter_app_badge: ^2.0.2 copied to clipboard

PlatformiOS

Plugin to update the app badge on the launcher iOS and macOS

example/lib/main.dart

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

void main() => runApp(const MyApp());

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

  @override
  MyAppState createState() => MyAppState();
}

class MyAppState extends State<MyApp> {
  final _supportedStatus = ValueNotifier<String>('Unknown');

  @override
  initState() {
    super.initState();
    _supportedStatus.addListener(() => setState(() {}));
  }

  @override
  dispose() {
    _supportedStatus.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'flutter_app_badge',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter_app_badge'),
        ),
        body: ListView(
          children: [
            for (int i in [10, 1, 0, -1])
              ListTile(
                onTap: () => FlutterAppBadge.count(i),
                leading: Icon(i > 0 ? Icons.add : Icons.remove),
                title: Text('FlutterAppBadge.count($i)'),
              ),
          ],
        ),
      ),
    );
  }
}
21
likes
160
pub points
96%
popularity

Publisher

unverified uploader

Plugin to update the app badge on the launcher iOS and macOS

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_app_badge