Skip to content

Commit

Permalink
feat(#59): Adiciona botão de requisição ao invés do elevatedButton
Browse files Browse the repository at this point in the history
  • Loading branch information
EngDann committed Dec 28, 2024
1 parent fc4872f commit 4e4852d
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/ui/register_account/view/register_account_view.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<Object>(
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');
},
);
}
Expand Down

0 comments on commit 4e4852d

Please sign in to comment.