My first screen is a login screen and it needs to check if the user is logged in to open the home screen directly but I get an error using this check.
I\'m doing the che
Achieved without Firebase, but by using SharedPreferences
here is a simple code: Main.dart
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
final SharedPreferences prefs = await SharedPreferences.getInstance();
var isLoggedIn = (prefs.getBool('isLoggedIn') == null) ? false : prefs.getBool('isLoggedIn');
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: isLoggedIn ? anotherPage() : loginPage(),
));
}
using flutter package: shared_preferences