I get the idea of automatically navigating based on if the user has data or not, but what I'm facing a problem with is how to check if the user has verified their email and based on that navigate to the new route.
note: i tried using "FirebaseAuth.instance.currentUser.emailVerified == condition" but it didnt work
class WrapperView extends GetView<WrapperController> {
const WrapperView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: FirebaseAuth.instance.authStateChanges(),
builder: ((BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
Get.log('has data');
return ProfileView();
} else {
Get.log('has no data');
return SplashView();
}
}),
);
}
}