I need when the user open the application, the splash screen opens. The splash screen decided if the user is gonna go to home page or sign in, using middleware in GetX layer.
this function:
@override
RouteSettings? redirect(String? route) async{ // -> error
GetSignedInUserInfoRepoImp _sigenedInUser = GetSignedInUserInfoRepoImp();
if ( await _sigenedInUser.isUserSignedIn()) {
return const RouteSettings(name: Routes.HOME);
} else {
return const RouteSettings(name: Routes.SIGN_IN);
}
}
but i can not use redirect function with future function. what should i do?