fbmobile/lib/ui/app_router.dart
Varakh b55e932204
All checks were successful
continuous-integration/drone/push Build is passing
Added proper linting #noissue
2023-01-04 21:17:54 +01:00

35 lines
1.2 KiB
Dart

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:
return MaterialPageRoute(builder: (_) => const StartUpView());
case AboutView.routeName:
return MaterialPageRoute(builder: (_) => const AboutView());
case HomeView.routeName:
return MaterialPageRoute(builder: (_) => const TabBarContainerView());
case LoginView.routeName:
return MaterialPageRoute(builder: (_) => LoginView());
case ProfileView.routeName:
return MaterialPageRoute(builder: (_) => const ProfileView());
default:
return MaterialPageRoute(
builder: (_) => Scaffold(
body: Center(
child: Text(translate('dev.no_route', args: {'route': settings.name})),
),
));
}
}
}