2025-06-17 09:43:09 -05:00
|
|
|
import 'package:home_widget/home_widget.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
|
2025-06-25 13:06:24 +05:30
|
|
|
final widgetRepositoryProvider = Provider((_) => const WidgetRepository());
|
2025-06-17 09:43:09 -05:00
|
|
|
|
2025-06-23 11:27:44 -05:00
|
|
|
class WidgetRepository {
|
2025-06-25 13:06:24 +05:30
|
|
|
const WidgetRepository();
|
2025-06-17 09:43:09 -05:00
|
|
|
|
|
|
|
Future<void> saveData(String key, String value) async {
|
|
|
|
await HomeWidget.saveWidgetData<String>(key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> refresh(String name) async {
|
|
|
|
await HomeWidget.updateWidget(name: name, iOSName: name);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> setAppGroupId(String appGroupId) async {
|
|
|
|
await HomeWidget.setAppGroupId(appGroupId);
|
|
|
|
}
|
|
|
|
}
|