Files
umbrix/lib/services/service_providers.dart

27 lines
968 B
Dart
Raw Normal View History

2023-09-20 22:38:38 +03:30
import 'package:hiddify/data/data_providers.dart';
import 'package:hiddify/services/cron_service.dart';
2023-07-06 17:18:41 +03:30
import 'package:hiddify/services/files_editor_service.dart';
2023-10-26 13:51:20 +03:30
import 'package:hiddify/services/platform_services.dart';
2023-08-19 22:27:23 +03:30
import 'package:hiddify/services/singbox/singbox_service.dart';
2023-07-06 17:18:41 +03:30
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'service_providers.g.dart';
@Riverpod(keepAlive: true)
FilesEditorService filesEditorService(FilesEditorServiceRef ref) =>
2023-10-26 13:51:20 +03:30
FilesEditorService(ref.watch(platformServicesProvider));
2023-07-06 17:18:41 +03:30
2023-08-19 22:27:23 +03:30
@Riverpod(keepAlive: true)
SingboxService singboxService(SingboxServiceRef ref) => SingboxService();
2023-10-26 13:51:20 +03:30
@Riverpod(keepAlive: true)
PlatformServices platformServices(PlatformServicesRef ref) =>
PlatformServices();
2023-09-20 22:38:38 +03:30
@Riverpod(keepAlive: true)
CronService cronService(CronServiceRef ref) {
final service = CronService(ref.watch(sharedPreferencesProvider));
ref.onDispose(() => service.stopScheduler());
return service;
}