updateWidgetData method
Updates widget data.
data is the widget data to update.
widgetSize is the size of the widget ('small', 'medium', or 'large').
Implementation
Future<void> updateWidgetData({
required WidgetData data,
required String widgetSize,
}) async {
try {
await _methodChannel.invokeMethod('updateWidgetData', {
'data': data.toJson(),
'widgetSize': widgetSize,
});
} catch (e) {
throw Exception('Failed to update widget data: $e');
}
}