From 9830e3695915c967c153ca518abaf2611ded984a Mon Sep 17 00:00:00 2001 From: Felipe Sales Date: Tue, 28 May 2024 22:00:46 -0300 Subject: [PATCH] fix: adjust for works in app and in test --- .../contact/presentation/cubit/contact_cubit.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/app/features/contact/presentation/cubit/contact_cubit.dart b/lib/app/features/contact/presentation/cubit/contact_cubit.dart index 9c96137..745c4ad 100644 --- a/lib/app/features/contact/presentation/cubit/contact_cubit.dart +++ b/lib/app/features/contact/presentation/cubit/contact_cubit.dart @@ -12,13 +12,13 @@ class ContactCubit extends Cubit { required ContactRepository contactRepository, AppLocalizations? appLocalizations, }) : _contactRepository = contactRepository, - _appLocalizations = appLocalizations ?? AppTexts.getViaNavigatorKey, + _appLocalizations = appLocalizations, super( const ContactInitial(), ); final ContactRepository _contactRepository; - final AppLocalizations _appLocalizations; + final AppLocalizations? _appLocalizations; Future sendMail({ required ContactModel contact, @@ -32,14 +32,16 @@ class ContactCubit extends Cubit { emit( ContactSuccess( contact: contactAnswer, - message: _appLocalizations.emailSendedWithSuccess, + message: (_appLocalizations ?? AppTexts.getViaNavigatorKey) + .emailSendedWithSuccess, ), ); case Failure(error: final contactFailedResult): emit( ContactError( contact: contact, - message: contactFailedResult.message(_appLocalizations), + message: contactFailedResult + .message(_appLocalizations ?? AppTexts.getViaNavigatorKey), ), ); }