Rumahjo-Android-APP/lib/data/model/system_settings_model.dart

49 lines
907 B
Dart
Raw Normal View History

2024-09-07 00:58:50 +00:00
enum SystemSetting {
maintenanceMode,
currencySymball,
subscription,
privacyPolicy,
termsConditions,
contactUs,
language,
defaultLanguage,
forceUpdate,
androidVersion,
numberWithSuffix,
iosVersion,
demoMode
}
/// we made this method because from our api all data comes in {'type':"<setting>",'data':"demo data"} this formate so we have list of these data and instead of create different methods and parse in it we have made enum and checking where condition in list
// T getSetting<T>(SystemSetting setting) {
// if (setting == SystemSetting.subscription) {
// if (subscription == true) {
// return package as T;
// } else {
// return null as T;
// }
// }
// return data!
// .where((Data element) =>
// element.type == Constant.systemSettingKey[setting])
// .toList()[0] as T;
// }