import 'package:flutter_libtor/flutter_libtor.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/utilities/stack_file_system.dart'; final pTorService = Provider((_) => TorService.sharedInstance); class TorService { static final sharedInstance = TorService(); final _tor = Tor(); int get port => _tor.port; Future start() async { final dir = await StackFileSystem.applicationTorDirectory(); return await _tor.start(torDir: dir); } Future stop() async { return await _tor.disable(); } }