icon_replance_csx 0.0.3+1 copy "icon_replance_csx: ^0.0.3+1" to clipboard
icon_replance_csx: ^0.0.3+1 copied to clipboard

A versatile library supporting dynamic replacement of app launch icons on Android and iOS, helping apps achieve customizable branding and visual identity management.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:icon_replance_csx/icon_replance_csx.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
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Column(
          children: [
            ElevatedButton(
              onPressed: () => IconReplanceCsx().removeSysAlert(),
              child: Text('remove alert'),
            ),
            ElevatedButton(
              onPressed: () => IconReplanceCsx().resetSysAlert(),
              child: Text('reset alert'),
            ),
            ElevatedButton(
              onPressed: () => NormalTool.changeIcon('AppIcon1'),
              child: Text('更换AppIcon1'),
            ),
            ElevatedButton(
              onPressed: () => NormalTool.changeIcon('AppIcon2'),
              child: Text('更换AppIcon2'),
            ),
            ElevatedButton(
              onPressed: () => NormalTool.changeIcon(null),
              child: Text('恢复原来'),
            ),
          ],
        ),
      ),
    );
  }
}

class NormalTool {
  static Future changeIcon(String? iconName) async {
    // await IconReplanceCsx().removeSysAlert();
    var result = await IconReplanceCsx().changeIcon(
      iconName,
      aliasNames: ['AppIcon', 'AppIcon1', 'AppIcon2'],
      // changeNow: true,
    );
    // await IconReplanceCsx().resetSysAlert();
    print('${result?.toJson()}');
  }
}
1
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A versatile library supporting dynamic replacement of app launch icons on Android and iOS, helping apps achieve customizable branding and visual identity management.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on icon_replance_csx

Packages that implement icon_replance_csx