From 6b2d00be26f69e3e3538d761af66c68e9378c726 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Tue, 5 Nov 2024 08:41:40 -0300 Subject: [PATCH] fiz: update storage util --- .../services/localization/localization_service.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/shared/services/localization/localization_service.dart b/lib/shared/services/localization/localization_service.dart index 426049a7..0bf1e004 100644 --- a/lib/shared/services/localization/localization_service.dart +++ b/lib/shared/services/localization/localization_service.dart @@ -272,10 +272,10 @@ class LocalizationService { } static Future _updateStorageUtil(Map jsonBody) async { - await StorageHelper.instance.set(SQLiteStorageKey.whatsapp.value, jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage); - await StorageHelper.instance.set(SQLiteStorageKey.provisional.value, jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage); - await StorageHelper.instance.set(SQLiteStorageKey.pets.value, jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage); - await StorageHelper.instance.set(SQLiteStorageKey.petAmount.value, jsonBody['petAmountRegister'].toString().isEmpty ? '0' : jsonBody['petAmountRegister'].toString(), Storage.SQLiteStorage); + await StorageHelper.instance.set(SQLiteStorageKey.whatsapp.value, jsonBody['whatsapp'] != null && jsonBody['whatsapp'] ? 'true' : 'false', Storage.SQLiteStorage); + await StorageHelper.instance.set(SQLiteStorageKey.provisional.value, jsonBody['provisional'] != null && jsonBody['provisional'] ? 'true' : 'false', Storage.SQLiteStorage); + await StorageHelper.instance.set(SQLiteStorageKey.pets.value, jsonBody['pet'] != null && jsonBody['pet'] ? 'true' : 'false', Storage.SQLiteStorage); + await StorageHelper.instance.set(SQLiteStorageKey.petAmount.value, jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty ? '0' : jsonBody['petAmountRegister'].toString(), Storage.SQLiteStorage); await StorageHelper.instance.set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage); } }