fix: SystemType(#184) & opt.: ios home widget

This commit is contained in:
lollipopkit
2023-10-14 13:26:15 +08:00
parent 930697d033
commit 9a4a7cef4c
8 changed files with 150 additions and 68 deletions

View File

@@ -9,15 +9,16 @@ enum SystemType {
const SystemType._(this.value);
static SystemType? parse(String? value) {
if (value == null) return null;
switch (value) {
static SystemType parse(String value) {
switch (value.trim()) {
case linuxSign:
return SystemType.linux;
case bsdSign:
return SystemType.bsd;
default:
// Fallback to linux
return SystemType.linux;
}
return null;
}
bool isSegmentsLenMatch(int len) => len == segmentsLen;