2023-01-23 05:46:09 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/bloc/user_bloc.dart';
|
|
|
|
import 'package:unit2/screens/unit2/login/login.dart';
|
|
|
|
import 'package:unit2/utils/global_context.dart';
|
2023-01-26 02:15:00 +00:00
|
|
|
import '../screens/profile/profile.dart';
|
2023-01-23 08:23:20 +00:00
|
|
|
import '../screens/unit2/basic-info/basic-info.dart';
|
2023-01-23 05:46:09 +00:00
|
|
|
import '../screens/unit2/homepage.dart/components/drawer-screen.dart';
|
2023-01-23 08:23:20 +00:00
|
|
|
import '../screens/unit2/login/qr_login.dart';
|
2023-01-23 05:46:09 +00:00
|
|
|
|
|
|
|
class AppRouter {
|
|
|
|
Route onGenerateRoute(RouteSettings routeSettings) {
|
|
|
|
switch (routeSettings.name) {
|
|
|
|
case '/':
|
|
|
|
BlocProvider.of<UserBloc>(
|
|
|
|
NavigationService.navigatorKey.currentContext!)
|
|
|
|
.add(GetApkVersion());
|
|
|
|
return MaterialPageRoute(builder: (_) {
|
|
|
|
return const UniT2Login();
|
|
|
|
});
|
|
|
|
case '/module-screen':
|
2023-01-26 02:15:00 +00:00
|
|
|
// BlocProvider.of<UserBloc>( NavigationService.navigatorKey.currentContext!).add(LoadLoggedInUser());
|
2023-01-23 05:46:09 +00:00
|
|
|
return MaterialPageRoute(builder: (_) {
|
|
|
|
return const DrawerScreen();
|
|
|
|
});
|
2023-01-23 08:23:20 +00:00
|
|
|
case '/basic-info':
|
2023-01-26 02:15:00 +00:00
|
|
|
return MaterialPageRoute(builder: (_) {
|
|
|
|
return const BasicInfo();
|
|
|
|
});
|
2023-01-23 08:23:20 +00:00
|
|
|
case '/qr-login':
|
2023-01-26 02:15:00 +00:00
|
|
|
return MaterialPageRoute(builder: (_) {
|
|
|
|
return const QRLogin();
|
|
|
|
});
|
|
|
|
case '/profile':
|
|
|
|
return MaterialPageRoute(builder: (_) {
|
|
|
|
return const ProfileInfo();
|
|
|
|
});
|
2023-01-23 05:46:09 +00:00
|
|
|
default:
|
|
|
|
return MaterialPageRoute(builder: (context) {
|
|
|
|
return Container();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|