setIcon method
Sets the app icon to the specified icon name.
iconName - The name of the icon to set. Pass null to reset to default.
Returns a map containing:
success(bool)iconName(String?) for successful updateserror(String?) orerrorMessage(String?) for failed updates
Implementation
@override
Future<Map<String, dynamic>> setIcon(String? iconName) async {
try {
final result = await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
'setIcon',
{'iconName': iconName},
);
return Map<String, dynamic>.from(result ?? {'success': false, 'error': 'No response from platform'});
} on PlatformException catch (e) {
return {'success': false, 'error': e.message};
}
}