mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
flutter_desktop: connection type icon, tested windows
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -45,12 +45,17 @@ class ConnectionType {
|
||||
Rx<String> get secure => _secure;
|
||||
Rx<String> get direct => _direct;
|
||||
|
||||
static String get strSecure => 'secure';
|
||||
static String get strInsecure => 'insecure';
|
||||
static String get strDirect => '';
|
||||
static String get strIndirect => '_relay';
|
||||
|
||||
void setSecure(bool v) {
|
||||
_secure.value = v ? 'secure' : 'insecure';
|
||||
_secure.value = v ? strSecure : strInsecure;
|
||||
}
|
||||
|
||||
void setDirect(bool v) {
|
||||
_direct.value = v ? '' : '_relay';
|
||||
_direct.value = v ? strDirect : strIndirect;
|
||||
}
|
||||
|
||||
bool isValid() {
|
||||
@@ -63,11 +68,20 @@ class ConnectionTypeState {
|
||||
static String tag(String id) => 'connection_type_$id';
|
||||
|
||||
static void init(String id) {
|
||||
final ConnectionType collectionType = ConnectionType();
|
||||
Get.put(collectionType, tag: tag(id));
|
||||
final key = tag(id);
|
||||
if (!Get.isRegistered(tag: key)) {
|
||||
final ConnectionType collectionType = ConnectionType();
|
||||
Get.put(collectionType, tag: key);
|
||||
}
|
||||
}
|
||||
|
||||
static void delete(String id) {
|
||||
final key = tag(id);
|
||||
if (Get.isRegistered(tag: key)) {
|
||||
Get.delete(tag: key);
|
||||
}
|
||||
}
|
||||
|
||||
static void delete(String id) => Get.delete(tag: tag(id));
|
||||
static ConnectionType find(String id) =>
|
||||
Get.find<ConnectionType>(tag: tag(id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user