I currently managed to finish my web app and I tried to make it so that the user doesn't have to log in every time he/she accesses the app. This works in debugging mode but as soon as I deploy it on the actual web using firebase, every time you refresh the app it asks you to log in again. I've trying doing it using a Future builder and even check the current user. Everything works in debugging but on the real website that doesn't work.
Code:
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(),
scrollBehavior: ScrollConfiguration.of(context).copyWith(dragDevices: {
PointerDeviceKind.mouse,
PointerDeviceKind.touch,
}),
home: FirebaseAuth.instance.currentUser != null ? Homepage() : Login());
}
}