Skip to content

Commit

Permalink
feat(#60) adiciona view e viewModel para o recoverAccount
Browse files Browse the repository at this point in the history
Co-authored-by: MarinaGaldi <marina.agostini.galdi@gmail.com>
  • Loading branch information
GabrielCostaDeOliveira and MarinaGaldi committed Dec 12, 2024
1 parent 5ff0185 commit 4a9c766
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ui/login/view/LoginView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class _LoginState extends State<_Login> {
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const RecoverAccount(),
builder: (context) => RecoverAccount(),
),
);
},
Expand Down
61 changes: 56 additions & 5 deletions lib/ui/recover_account/view/RecoverAccount.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,63 @@
import 'package:aranduapp/ui/recover_account/viewModel/recoverAccountViewModel.dart';
import 'package:aranduapp/ui/shared/TextAndLink.dart';
import 'package:aranduapp/ui/shared/TextEmail.dart';
import 'package:aranduapp/ui/shared/TitleSlogan.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class RecoverAccount extends StatelessWidget{
const RecoverAccount({super.key});

class RecoverAccount extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
throw UnimplementedError();
return Scaffold(
body: ChangeNotifierProvider(
create: (context) => RecoverAccountViewModel(context),
child: page(context),
));
}

Widget page(BuildContext context) {
RecoverAccountViewModel viewModel =
Provider.of<RecoverAccountViewModel>(context);

return SingleChildScrollView(
child: Center(
child: Column(
children: <Widget>[
const SizedBox(height: 80),
const TitleSlogan(),
const Padding(
padding: EdgeInsets.only(top: 70, left: 20, right: 20),
child: Text(
'Coloque o seu e-mail no campo abaixo e clique em enviar. Logo em seguida, você receberá no seu e-mail as instruções para trocar a sua senha.',
),
),
Form(
key: viewModel.formKey,
child: Column(children: <Widget>[
TextEmail(
padding:
const EdgeInsets.only(top: 24, left: 20, right: 20),
controller: viewModel.emailController),
])),
Padding(
padding: const EdgeInsets.only(top: 80),
child: SizedBox(
width: 291,
height: 64,
child: ElevatedButton(
onPressed: () {}, child: const Text('Enviar')),
),
),
TextAndLink(
text: 'Já tem uma conta?',
link: ' Click aqui',
action: () {
Navigator.of(context).pop();
},
)
],
),
),
);
}
}
13 changes: 13 additions & 0 deletions lib/ui/recover_account/viewModel/recoverAccountViewModel.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:flutter/material.dart';

class RecoverAccountViewModel extends ChangeNotifier {
final BuildContext context;

final formKey;

final emailController;

RecoverAccountViewModel(this.context)
: formKey = GlobalKey<FormState>(),
emailController = TextEditingController();
}

0 comments on commit 4a9c766

Please sign in to comment.