edit backgroun and inmclude
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
class SchoolSettings {
|
||||
final int portalPurchasesEnabled;
|
||||
final String allowedProductTypes;
|
||||
final String paymentMethods;
|
||||
final String currencyCode;
|
||||
|
||||
final int enableNotifications;
|
||||
final int allowFreezeGlobal;
|
||||
final int freezeMaxDaysGlobal;
|
||||
|
||||
final int autoPropagateOnPurchase;
|
||||
final int allowFullAccessRebooking;
|
||||
|
||||
final List<String> paymentMethodsArray;
|
||||
final List<String> allowedProductTypesArray;
|
||||
|
||||
const SchoolSettings({
|
||||
required this.portalPurchasesEnabled,
|
||||
required this.allowedProductTypes,
|
||||
required this.paymentMethods,
|
||||
required this.currencyCode,
|
||||
required this.enableNotifications,
|
||||
required this.allowFreezeGlobal,
|
||||
required this.freezeMaxDaysGlobal,
|
||||
required this.autoPropagateOnPurchase,
|
||||
required this.allowFullAccessRebooking,
|
||||
required this.paymentMethodsArray,
|
||||
required this.allowedProductTypesArray,
|
||||
});
|
||||
|
||||
factory SchoolSettings.fromMap(Map<String, dynamic> m) {
|
||||
int i(dynamic v) => (v is num) ? v.toInt() : int.tryParse('$v') ?? 0;
|
||||
String s(dynamic v, [String def = '']) => (v ?? def).toString();
|
||||
|
||||
List<String> list(dynamic v) {
|
||||
if (v is List) return v.map((e) => e.toString()).toList();
|
||||
return [];
|
||||
}
|
||||
|
||||
return SchoolSettings(
|
||||
portalPurchasesEnabled: i(m['portal_purchases_enabled']),
|
||||
allowedProductTypes: s(m['allowed_product_types']),
|
||||
paymentMethods: s(m['payment_methods']),
|
||||
currencyCode: s(m['currency_code'], 'EUR'),
|
||||
enableNotifications: i(m['enable_notifications']),
|
||||
allowFreezeGlobal: i(m['allow_freeze_global']),
|
||||
freezeMaxDaysGlobal: i(m['freeze_max_days_global']),
|
||||
autoPropagateOnPurchase: i(m['auto_propagate_on_purchase']),
|
||||
allowFullAccessRebooking: i(m['allow_full_access_rebooking']),
|
||||
paymentMethodsArray: list(m['payment_methods_array']),
|
||||
allowedProductTypesArray: list(m['allowed_product_types_array']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'portal_purchases_enabled': portalPurchasesEnabled,
|
||||
'allowed_product_types': allowedProductTypes,
|
||||
'payment_methods': paymentMethods,
|
||||
'currency_code': currencyCode,
|
||||
'enable_notifications': enableNotifications,
|
||||
'allow_freeze_global': allowFreezeGlobal,
|
||||
'freeze_max_days_global': freezeMaxDaysGlobal,
|
||||
'auto_propagate_on_purchase': autoPropagateOnPurchase,
|
||||
'allow_full_access_rebooking': allowFullAccessRebooking,
|
||||
'payment_methods_array': paymentMethodsArray,
|
||||
'allowed_product_types_array': allowedProductTypesArray,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
class UserSettings {
|
||||
final int notifyEmail;
|
||||
final int notifyWhatsapp;
|
||||
final int notifyPush;
|
||||
|
||||
final int notifyBookingConfirm;
|
||||
final int notifyBookingCancel;
|
||||
final int notifySessionCancel;
|
||||
final int notifyPaymentReceipt;
|
||||
final int notifyExpirationReminder;
|
||||
|
||||
final int newsletterOptIn;
|
||||
final int marketingOptIn;
|
||||
|
||||
final String locale;
|
||||
final String timezone;
|
||||
|
||||
const UserSettings({
|
||||
required this.notifyEmail,
|
||||
required this.notifyWhatsapp,
|
||||
required this.notifyPush,
|
||||
required this.notifyBookingConfirm,
|
||||
required this.notifyBookingCancel,
|
||||
required this.notifySessionCancel,
|
||||
required this.notifyPaymentReceipt,
|
||||
required this.notifyExpirationReminder,
|
||||
required this.newsletterOptIn,
|
||||
required this.marketingOptIn,
|
||||
required this.locale,
|
||||
required this.timezone,
|
||||
});
|
||||
|
||||
factory UserSettings.fromMap(Map<String, dynamic> m) {
|
||||
int i(dynamic v) => (v is num) ? v.toInt() : int.tryParse('$v') ?? 0;
|
||||
String s(dynamic v, [String def = '']) => (v ?? def).toString();
|
||||
|
||||
return UserSettings(
|
||||
notifyEmail: i(m['notify_email']),
|
||||
notifyWhatsapp: i(m['notify_whatsapp']),
|
||||
notifyPush: i(m['notify_push']),
|
||||
notifyBookingConfirm: i(m['notify_booking_confirm']),
|
||||
notifyBookingCancel: i(m['notify_booking_cancel']),
|
||||
notifySessionCancel: i(m['notify_session_cancel']),
|
||||
notifyPaymentReceipt: i(m['notify_payment_receipt']),
|
||||
notifyExpirationReminder: i(m['notify_expiration_reminder']),
|
||||
newsletterOptIn: i(m['newsletter_opt_in']),
|
||||
marketingOptIn: i(m['marketing_opt_in']),
|
||||
locale: s(m['locale'], 'it'),
|
||||
timezone: s(m['timezone'], 'Europe/Rome'),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'notify_email': notifyEmail,
|
||||
'notify_whatsapp': notifyWhatsapp,
|
||||
'notify_push': notifyPush,
|
||||
'notify_booking_confirm': notifyBookingConfirm,
|
||||
'notify_booking_cancel': notifyBookingCancel,
|
||||
'notify_session_cancel': notifySessionCancel,
|
||||
'notify_payment_receipt': notifyPaymentReceipt,
|
||||
'notify_expiration_reminder': notifyExpirationReminder,
|
||||
'newsletter_opt_in': newsletterOptIn,
|
||||
'marketing_opt_in': marketingOptIn,
|
||||
'locale': locale,
|
||||
'timezone': timezone,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user