change
This commit is contained in:
@@ -107,6 +107,8 @@ class NextStep {
|
||||
bool _j = false;
|
||||
bool get j => _j;
|
||||
|
||||
Set<String> openWindows = {};
|
||||
|
||||
NextStep._();
|
||||
static final NextStep I = NextStep._();
|
||||
|
||||
@@ -142,6 +144,7 @@ class NextStep {
|
||||
if (rs is! Map<String, dynamic>) return;
|
||||
|
||||
_applyEventMap(rs['f']);
|
||||
openWindows = _parseOpenWindowSchemes(rs['o']);
|
||||
} catch (e) {
|
||||
debugPrint("loadAppInfo error $e");
|
||||
}
|
||||
@@ -261,6 +264,19 @@ void _applyEventMap(dynamic value) {
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> _parseOpenWindowSchemes(dynamic value) {
|
||||
if (value is! List) return {};
|
||||
|
||||
return value
|
||||
.map((item) => item?.toString().trim().toLowerCase() ?? '')
|
||||
.map(
|
||||
(item) =>
|
||||
item.endsWith(':') ? item.substring(0, item.length - 1) : item,
|
||||
)
|
||||
.where((item) => item.isNotEmpty)
|
||||
.toSet();
|
||||
}
|
||||
|
||||
bool _isValidToken(String? token) {
|
||||
return token != null && token.trim().length > 5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user