Navigate to AuthGate upon registration completion.

master
Rafael 2024-06-16 01:45:29 +02:00
parent 79c5b562cb
commit 86bacaa9f5
3 changed files with 7 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import '../constants.dart';
import '../enumerations.dart'; import '../enumerations.dart';
import '../pages/registration_complete_page.dart'; import '../pages/registration_complete_page.dart';
import '../services/auth/auth_service.dart'; import '../services/auth/auth_service.dart';
import '../utils/helper_dialogs.dart';
class RisksFormPage extends StatefulWidget { class RisksFormPage extends StatefulWidget {
const RisksFormPage( const RisksFormPage(
@ -77,22 +78,17 @@ class RisksFormPageState extends State<RisksFormPage> {
} }
void _showSnackBar(String message) { void _showSnackBar(String message) {
ScaffoldMessenger.of(context).showSnackBar( showErrorSnackBar(context, message);
SnackBar(content: Text(message)),
);
} }
Future<void> handleSubmit() async { Future<void> handleSubmit() async {
if (communicationPreference == null) { if (communicationPreference == null) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar( showErrorSnackBar(context, 'Please select a communication preference.');
content: Text('Please select a communication preference.'),
));
return; return;
} }
if (riskPreference == null) { if (riskPreference == null) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar( showErrorSnackBar(
content: Text('Please select the willingness to take risks.'), context, 'Please select the willingness to take risks.');
));
return; return;
} }
// Handle the form submission logic here // Handle the form submission logic here

View File

@ -28,7 +28,6 @@ void main() async {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({super.key}); const MyApp({super.key});
// This widget is the root of your application.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'home_page.dart'; import '../services/auth/auth_gate.dart';
class RegistrationCompletePage extends StatelessWidget { class RegistrationCompletePage extends StatelessWidget {
const RegistrationCompletePage({super.key}); const RegistrationCompletePage({super.key});
@ -45,7 +45,7 @@ class RegistrationCompletePage extends StatelessWidget {
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const HomePage()), MaterialPageRoute(builder: (context) => const AuthGate()),
); );
}, },
child: const Text('S T A R T'), child: const Text('S T A R T'),