integrated with previous
This commit is contained in:
25
lib/common/state/game/game_controller.dart
Normal file
25
lib/common/state/game/game_controller.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/user.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/screens/auth/controller/auth_controller.dart';
|
||||
|
||||
class GameController extends GetxController{
|
||||
|
||||
AuthController authController = Get.find<AuthController>();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
ever(authController.authList, changeInAuth);
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
void changeInAuth(List<AuthResponse> change){
|
||||
if(change.isNotEmpty){
|
||||
Get.toNamed(AppPages.S_HOME);
|
||||
}
|
||||
else{
|
||||
Get.toNamed(AppPages.S_LOGIN);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user