борт управления самолетом
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'persisted_setting.dart';
|
||||
|
||||
class AppMicrophone {
|
||||
static const prefKey = 'call_microphone_id';
|
||||
static const String defaultValue = '';
|
||||
|
||||
static final _setting = PersistedSetting<String>(
|
||||
prefKey: prefKey,
|
||||
defaultValue: defaultValue,
|
||||
read: (prefs, key) => prefs.getString(key),
|
||||
write: (prefs, key, value) async {
|
||||
await prefs.setString(key, value);
|
||||
},
|
||||
);
|
||||
|
||||
static ValueNotifier<String> get current => _setting.current;
|
||||
|
||||
static String? get deviceId =>
|
||||
_setting.current.value.isEmpty ? null : _setting.current.value;
|
||||
|
||||
static Future<String> load() => _setting.load();
|
||||
|
||||
static Future<void> save(String value) => _setting.save(value);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'persisted_setting.dart';
|
||||
|
||||
class AppPulseSource {
|
||||
static const prefKey = 'call_pulse_source';
|
||||
static const String defaultValue = '';
|
||||
|
||||
static final _setting = PersistedSetting<String>(
|
||||
prefKey: prefKey,
|
||||
defaultValue: defaultValue,
|
||||
read: (prefs, key) => prefs.getString(key),
|
||||
write: (prefs, key, value) async {
|
||||
await prefs.setString(key, value);
|
||||
},
|
||||
);
|
||||
|
||||
static ValueNotifier<String> get current => _setting.current;
|
||||
|
||||
static String? get name =>
|
||||
_setting.current.value.isEmpty ? null : _setting.current.value;
|
||||
|
||||
static Future<String> load() => _setting.load();
|
||||
|
||||
static Future<void> save(String value) => _setting.save(value);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class CallNoMute {
|
||||
CallNoMute._();
|
||||
|
||||
static const String flag = '--no-mute';
|
||||
|
||||
static bool enabled = const bool.fromEnvironment('NO_MUTE');
|
||||
|
||||
static void parse(List<String> args) {
|
||||
if (args.contains(flag)) enabled = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user