mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
@ -9,28 +9,28 @@ extension AccessTypeExtension on AccessType {
|
||||
String get value {
|
||||
switch (this) {
|
||||
case AccessType.onlineOnetime:
|
||||
return 'Online Password';
|
||||
return "Online Password";
|
||||
case AccessType.onlineMultiple:
|
||||
return 'online Multiple Password';
|
||||
return "online Multiple Password";
|
||||
case AccessType.offlineOnetime:
|
||||
return 'Offline Onetime Password';
|
||||
return "Offline Onetime Password";
|
||||
case AccessType.offlineMultiple:
|
||||
return 'Offline Multiple Password';
|
||||
return "Offline Multiple Password";
|
||||
}
|
||||
}
|
||||
|
||||
static AccessType fromString(String value) {
|
||||
switch (value) {
|
||||
case 'ONLINE_ONETIME':
|
||||
case "ONLINE_ONETIME":
|
||||
return AccessType.onlineOnetime;
|
||||
case 'ONLINE_MULTIPLE':
|
||||
case "ONLINE_MULTIPLE":
|
||||
return AccessType.onlineMultiple;
|
||||
case 'OFFLINE_ONETIME':
|
||||
case "OFFLINE_ONETIME":
|
||||
return AccessType.offlineOnetime;
|
||||
case 'OFFLINE_MULTIPLE':
|
||||
case "OFFLINE_MULTIPLE":
|
||||
return AccessType.offlineMultiple;
|
||||
default:
|
||||
throw ArgumentError('Invalid access type: $value');
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -44,9 +44,9 @@ extension OnlineTypeExtension on DeviseStatus {
|
||||
String get value {
|
||||
switch (this) {
|
||||
case DeviseStatus.online:
|
||||
return 'Online';
|
||||
return "Online";
|
||||
case DeviseStatus.offline:
|
||||
return 'Offline';
|
||||
return "Offline";
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ extension OnlineTypeExtension on DeviseStatus {
|
||||
case true:
|
||||
return DeviseStatus.online;
|
||||
default:
|
||||
throw ArgumentError('Invalid access type: $value');
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,24 +72,24 @@ extension AccessStatusExtension on AccessStatus {
|
||||
String get value {
|
||||
switch (this) {
|
||||
case AccessStatus.expired:
|
||||
return 'Expired';
|
||||
return "Expired";
|
||||
case AccessStatus.effective:
|
||||
return 'Effective';
|
||||
return "Effective";
|
||||
case AccessStatus.toBeEffective:
|
||||
return 'To be effective';
|
||||
return "To be effective";
|
||||
}
|
||||
}
|
||||
|
||||
static AccessStatus fromString(String value) {
|
||||
switch (value) {
|
||||
case 'EXPIRED':
|
||||
case "EXPIRED":
|
||||
return AccessStatus.expired;
|
||||
case 'EFFECTIVE':
|
||||
case "EFFECTIVE":
|
||||
return AccessStatus.effective;
|
||||
case 'TO_BE_EFFECTIVE':
|
||||
case "TO_BE_EFFECTIVE":
|
||||
return AccessStatus.toBeEffective;
|
||||
default:
|
||||
throw ArgumentError('Invalid access type: $value');
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user