mirror of
https://github.com/DJDoubleD/refreezer.git
synced 2026-01-15 16:32:54 -03:00
Implement App Icon selection
- added 2 additional app icons to choose from - added translation string for settings screen - smaller changes + formatting some touched files
This commit is contained in:
25
lib/utils/app_icon_changer.dart
Normal file
25
lib/utils/app_icon_changer.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user