25-2/1/1
This commit is contained in:
18
lib/homw_widget.dart
Normal file
18
lib/homw_widget.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class WidgetManager {
|
||||
static const platform = MethodChannel('com.mobileapp.store.ride/widget');
|
||||
|
||||
static Future<void> updateWidget() async {
|
||||
try {
|
||||
await platform.invokeMethod('updateWidget');
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to update widget: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Example usage:
|
||||
void updateHomeScreenWidget() {
|
||||
WidgetManager.updateWidget();
|
||||
}
|
||||
Reference in New Issue
Block a user