Skip to content

Commit

Permalink
fix: adjust for works in app and in test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecastrosales committed May 29, 2024
1 parent a5545dd commit 9830e36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/app/features/contact/presentation/cubit/contact_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class ContactCubit extends Cubit<ContactState> {
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<void> sendMail({
required ContactModel contact,
Expand All @@ -32,14 +32,16 @@ class ContactCubit extends Cubit<ContactState> {
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),
),
);
}
Expand Down

0 comments on commit 9830e36

Please sign in to comment.