You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App_New/lib/core/enums.dart

67 lines
1.1 KiB
Dart

// enum APPSTATUS {
// loading,
// unAuthenticated,
// authenticated,
// unverified,
// }
enum AuthMethodTypesEnum {
sms,
whatsApp,
fingerPrint,
faceID,
moreOptions,
}
enum ViewStateEnum {
hide,
idle,
busy,
error,
busyLocal,
errorLocal,
}
enum LoginTypeEnum {
fromLogin,
silentLogin,
silentWithOTP,
}
enum CountryEnum { saudiArabia, unitedArabEmirates }
enum SelectionTypeEnum { dropdown, calendar }
enum GenderTypeEnum { male, female }
enum MaritalStatusTypeEnum { single, married, divorced, widowed }
enum ChipTypeEnum { success, error, alert, info, warning }
enum OTPTypeEnum { sms, whatsapp }
extension OTPTypeEnumExtension on OTPTypeEnum {
/// Convert enum to int
int toInt() {
switch (this) {
case OTPTypeEnum.sms:
return 1;
case OTPTypeEnum.whatsapp:
return 2;
}
}
/// Convert int to enum
static OTPTypeEnum fromInt(int value) {
switch (value) {
case 1:
return OTPTypeEnum.sms;
case 2:
return OTPTypeEnum.whatsapp;
default:
throw Exception("Invalid OTPTypeEnum value: $value");
}
}
}