This commit is contained in:
Felipe
2023-11-11 18:13:58 -05:00
parent f732d461d0
commit 24f0d80e32
15 changed files with 1439 additions and 194 deletions
+41 -16
View File
@@ -29,30 +29,55 @@ class SettingModel {
this.terminosCondiciones,
);
static Future<SettingModel> fromJson(Map<String, dynamic> json) async {
static Future<SettingModel> fromJson(Map<String, dynamic>? json) async {
try {
if (json == null)
if (json == null) {
return SettingModel(
false, false, false, '', '', '', '', '', '', '', '', '');
false,
false,
false,
'',
'',
'',
'',
'',
'',
'',
'',
'',
);
}
return SettingModel(
json['domicilio'],
json['google'],
json['tarifa'],
json['titulo_soporte'],
json['parrafo_soporte'],
json['numero_soporte'],
json['email_soporte'],
json['dias_soporte'],
json['horas_soporte'],
json['version'],
json['politicas_privacidad'],
json['terminos_condiciones'],
json['domicilios'] ?? false,
json['google'] ?? false,
json['tarifas'] ?? false,
json['titulo_soporte'] ?? '',
json['parrafo_soporte'] ?? '',
json['numero_soporte'] ?? '',
json['email_soporte'] ?? '',
json['dias_soporte'] ?? '',
json['horas_soporte'] ?? '',
json['version'] ?? '', // Asegúrate de manejar nulos aquí
json['politicas_privacidad'] ?? '',
json['terminos_condiciones'] ?? '',
);
} catch (e) {
print('Error settings: $e');
return SettingModel(
false, false, false, '', '', '', '', '', '', '', '', '');
false,
false,
false,
'',
'',
'',
'',
'',
'',
'',
'',
'',
);
}
}