mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2025-12-16 09:28:53 +00:00
27 lines
596 B
Dart
27 lines
596 B
Dart
import 'package:babylonia_terminal_launcher/messages/config.pb.dart';
|
|
|
|
class Config {
|
|
String path;
|
|
|
|
static late Config instance;
|
|
Config._({required this.path});
|
|
|
|
static bool _isLoadingConfig = false;
|
|
|
|
static Future update() async {
|
|
if (!_isLoadingConfig) {
|
|
_isLoadingConfig = true;
|
|
ConfigInput().sendSignalToRust();
|
|
final stream = ConfigOutput.rustSignalStream;
|
|
|
|
await for (final rustSignal in stream) {
|
|
instance = Config._(
|
|
path: rustSignal.message.configPath,
|
|
);
|
|
break;
|
|
}
|
|
_isLoadingConfig = false;
|
|
}
|
|
}
|
|
}
|