android_dynamic_icon 2.0.0 copy "android_dynamic_icon: ^2.0.0" to clipboard
android_dynamic_icon: ^2.0.0 copied to clipboard

PlatformAndroid

A flutter plugin for dynamically changing multiple android app icons for your app.

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  final _androidDynamicIconPlugin = AndroidDynamicIcon();

  @override
  void initState() {
    AndroidDynamicIcon.initialize(
        classNames: ['MainActivity', 'ExampleIconActivity']);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: GestureDetector(
          onTap: () async {
            await _androidDynamicIconPlugin
                .changeIcon(classNames: ['ExampleActivity', '']);
            // To change icon back to default one.
            // await _androidDynamicIconPlugin
            //     .changeIcon(classNames: ['MainActivity', '']);
          },
          child: const Center(
            child: Text('Change Icon'),
          ),
        ),
      ),
    );
  }
}
24
likes
160
points
467
downloads

Publisher

verified publisherdevyatharth.in

Weekly Downloads

A flutter plugin for dynamically changing multiple android app icons for your app.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_plugin_android_lifecycle, plugin_platform_interface

More

Packages that depend on android_dynamic_icon