mirror of
https://github.com/DJDoubleD/refreezer.git
synced 2026-01-15 16:32:54 -03:00
- added 2 additional app icons to choose from - added translation string for settings screen - smaller changes + formatting some touched files
26 lines
665 B
Dart
26 lines
665 B
Dart
import 'package:flutter/services.dart';
|
|
import 'package:logging/logging.dart';
|
|
|
|
class AppIconChanger {
|
|
static const MethodChannel _channel = MethodChannel('change_icon');
|
|
|
|
static Future<void> changeIcon(LauncherIcon icon) async {
|
|
try {
|
|
await _channel.invokeMethod('changeIcon', {'iconName': icon.key});
|
|
} on PlatformException catch (e) {
|
|
Logger.root.severe('Failed to change icon: ${e.message}');
|
|
}
|
|
}
|
|
|
|
static List<LauncherIcon> get availableIcons => LauncherIcon.values;
|
|
}
|
|
|
|
enum LauncherIcon {
|
|
defaultIcon('DefaultIcon'),
|
|
catIcon('CatIcon'),
|
|
deezerIcon('DeezerBlueIcon');
|
|
|
|
final String key;
|
|
const LauncherIcon(this.key);
|
|
}
|