diff --git a/lib/ui/register_account/view/register_account_view.dart b/lib/ui/register_account/view/register_account_view.dart index ed81652..65a92c3 100644 --- a/lib/ui/register_account/view/register_account_view.dart +++ b/lib/ui/register_account/view/register_account_view.dart @@ -1,7 +1,7 @@ -import 'package:aranduapp/ui/login/view/login_view.dart'; import 'package:aranduapp/ui/shared/OrDivider.dart'; import 'package:aranduapp/ui/shared/TextAndLink.dart'; import 'package:aranduapp/ui/shared/TextName.dart'; +import 'package:aranduapp/ui/shared/requestbutton.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:aranduapp/core/log/Log.dart'; @@ -135,18 +135,22 @@ class RegisterAccountScreen extends StatelessWidget { }); } - return SizedBox( - width: 291, - height: 64, - child: ElevatedButton( - onPressed: () async { - viewModel.registerCommand.execute(); + return Requestbutton( + command: viewModel.registerCommand, + onErrorCallback: (String e) { + showDialog( + context: context, + builder: (BuildContext context) => ErrorPopUp(content: Text(e)), + ); }, - child: viewModel.registerCommand.running - ? const CircularProgressIndicator(value: null) - : const Text('Registrar'), - ), - ); + onSuccessCallback: () { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text( + 'Bem-vindo(a) a bordo! Sua conta foi criada com sucesso!')), + ); + }, + nameButton: 'Enviar'); }, ); }