Closed mansbjorn closed 2 years ago
I solved this by using the authenticate widget properly, like this:
import 'package:flutter/material.dart';
import 'package:the_book_club/UI/login_logout/login_widget.dart';
import 'package:the_book_club/UI/login_logout/signup_widget.dart';
class Authenticate extends StatefulWidget {
@override
_AuthenticateState createState() => _AuthenticateState();
}
class _AuthenticateState extends State<Authenticate> {
bool showLogIn = true;
void toggleView() {
setState(() => showLogIn = !showLogIn);
}
@override
Widget build(BuildContext context) {
if (showLogIn) {
return LoginWidget(toggleView: toggleView);
} else {
return SignUpWidget(toggleView: toggleView);
}
}
}
I have been following the netninja tutorial on Firebase Auth but I have run into a problem. My signing is working well and the listener in my wrapper send the user directly to my homepage after signing in. However, my register page doesnt send the user onwards despite successfull registration. I have to update with hotrestart for the homescreen to appear.
Any and all help on this would be appreciated.
Here is my registration page:
Here is my wrapper:
Here is my main:
and finally here is my auth:
let me know if more files/details are necessary in order to answer my question, I cannot understand why it is not loading the homepage properly.