fbmobile/lib/ui/app_router.dart

37 lines
1.2 KiB
Dart
Raw Permalink Normal View History

2021-02-02 14:33:23 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';
import '../ui/views/tabbar_container_view.dart';
import 'views/about_view.dart';
import 'views/home_view.dart';
import 'views/login_view.dart';
import 'views/profile_view.dart';
import 'views/startup_view.dart';
const String initialRoute = "login";
class AppRouter {
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case StartUpView.routeName:
2023-01-04 20:17:54 +00:00
return MaterialPageRoute(builder: (_) => const StartUpView());
2021-02-02 14:33:23 +00:00
case AboutView.routeName:
2023-01-04 20:17:54 +00:00
return MaterialPageRoute(builder: (_) => const AboutView());
2021-02-02 14:33:23 +00:00
case HomeView.routeName:
2023-01-04 20:17:54 +00:00
return MaterialPageRoute(builder: (_) => const TabBarContainerView());
2021-02-02 14:33:23 +00:00
case LoginView.routeName:
return MaterialPageRoute(builder: (_) => LoginView());
case ProfileView.routeName:
2023-01-04 20:17:54 +00:00
return MaterialPageRoute(builder: (_) => const ProfileView());
2021-02-02 14:33:23 +00:00
default:
return MaterialPageRoute(
builder: (_) => Scaffold(
body: Center(
2023-01-16 00:44:34 +00:00
child: Text(translate('dev.no_route',
args: {'route': settings.name})),
2021-02-02 14:33:23 +00:00
),
));
}
}
}