-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance cubit with more control and models related for return t…
…ypes
- Loading branch information
1 parent
44bb684
commit ff4e89d
Showing
11 changed files
with
171 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export 'controller/controller.dart'; | ||
export 'widgets/widgets.dart'; | ||
export 'cubit/contact_cubit.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,9 @@ class CustomForm extends StatelessWidget { | |
required this.subjectController, | ||
required this.messageController, | ||
required this.onPressed, | ||
ContactController? contactController, | ||
}) : _contactController = contactController ?? | ||
ContactController( | ||
ContactCubit? contactCubit, | ||
}) : _contactCubit = contactCubit ?? | ||
ContactCubit( | ||
contactRepository: ContactRepositoryImpl( | ||
httpClient: getIt(), | ||
), | ||
|
@@ -30,8 +30,7 @@ class CustomForm extends StatelessWidget { | |
final TextEditingController subjectController; | ||
final TextEditingController messageController; | ||
final VoidCallback onPressed; | ||
|
||
final ContactController? _contactController; | ||
final ContactCubit? _contactCubit; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
@@ -77,9 +76,21 @@ class CustomForm extends StatelessWidget { | |
Center( | ||
child: AppTextButton( | ||
text: AppTexts.get(context).sendEmailUpper, | ||
onPressed: onPressed, | ||
|
||
/// TODO: | ||
// onPressed: onPressed, | ||
onPressed: () { | ||
_contactCubit?.sendMail( | ||
contact: ContactUser( | ||
name: 'felipe sales', | ||
email: '[email protected]', | ||
message: 'teste de mensagem', | ||
subject: 'vamos testar, mais uma vez', | ||
), | ||
); | ||
}, | ||
onLongPress: () { | ||
_contactController?.sendMail( | ||
_contactCubit?.sendMail( | ||
contact: ContactUser( | ||
name: 'felipe sales', | ||
email: '[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.