tor lifecycle management

This commit is contained in:
Fabian Freund
2025-03-16 20:55:33 +01:00
parent 6830d94bac
commit 9bc9c53559
10 changed files with 176 additions and 24 deletions
@@ -3,6 +3,7 @@ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:lensai/features/tor/domain/services/tor_proxy.dart';
import 'package:lensai/presentation/hooks/on_initialization.dart';
class TorProxyScreen extends HookConsumerWidget {
const TorProxyScreen();
@@ -11,6 +12,10 @@ class TorProxyScreen extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final torProxyPort = ref.watch(torProxyServiceProvider);
useOnInitialization(() async {
await ref.read(torProxyServiceProvider.notifier).requestSync();
});
return Scaffold(
appBar: AppBar(title: const Text('Tor Proxy')),
body: ColoredBox(