stack_wallet/lib/networking/tor_service.dart
sneurlax 662602bd2b use flutter_libarti main
now even newer and better
2023-09-01 17:46:42 -05:00

22 lines
576 B
Dart

import 'package:flutter_libarti/flutter_libarti.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<void> start() async {
final dir = await StackFileSystem.applicationTorDirectory();
await _tor.start(torDir: dir);
return;
}
Future<void> stop() async {
return await _tor.disable();
}
}