I'm trying to prevent users with deleted accounts on Firebase Auth from accessing my flutter app. However, I noticed that even after I deleted their account, they could still access the app, I tried to print to the console and noticed that even though the account was deleted on Firebase Auth, it somehow still exists on the client's machine. I wrote the test condition statement inside main function as follows:
final auth = FirebaseAuth.instance;
final user = auth.currentUser;
await DefaultCacheManager().emptyCache();
if (auth.currentUser == null) {
runApp(MyApp(initialScreen: LoginPage()));
dev.log('user:$user');
} else {
runApp(const MyApp(
initialScreen: MyHomePage(title: 'Home'),
));
dev.log('user:$user');
}