1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import 'package:flutter/material.dart';
- import 'package:flutter_tracker/index_page.dart';
- import 'package:flutter_tracker/pages/about_page.dart';
- import 'package:flutter_tracker/pages/help_page.dart';
- import 'package:flutter_tracker/pages/login/login_page.dart';
- import 'package:flutter_tracker/pages/tabs/mine_page.dart';
- import 'package:flutter_tracker/pages/login/register_page.dart';
- import 'package:flutter_tracker/pages/submit_page.dart';
- import 'package:flutter_tracker/pages/tabs/track_page.dart';
- import 'package:flutter_tracker/pages/welcome_page.dart';
- /// Description:
- /// Time : 2021年12月03日 Friday
- /// Author : liuyuqi.gov@msncn
- class Routes {
- static const String indexPage = "/index";
- static const String trackPage = '/track';
- static const String minePage = '/mine';
- static const String aboutPage = '/about_me';
- static const String helpPage = '/help';
- static const String loginPage = '/login';
- static const String registerPage = '/register';
- static const String submitPage = '/submit';
- static const String welPage = '/welcome';
- static Route<dynamic> generateRoute(RouteSettings settings) {
- switch (settings.name) {
- case indexPage:
- return MaterialPageRoute(builder: (_) => const IndexPage());
- case trackPage:
- return MaterialPageRoute(builder: (_) => const TrackPage());
- case minePage:
- return MaterialPageRoute(builder: (_) => const MinePage());
- case aboutPage:
- return MaterialPageRoute(builder: (_) => const AboutPage());
- case helpPage:
- return MaterialPageRoute(builder: (_) => const HelpPage());
- case loginPage:
- return MaterialPageRoute(builder: (_) => const LoginPage());
- case registerPage:
- return MaterialPageRoute(builder: (_) => const RegisterPage());
- case submitPage:
- return MaterialPageRoute(builder: (_) => const SubmitPage());
- case welPage:
- return MaterialPageRoute(builder: (_) => const WelComePage());
- default:
- return MaterialPageRoute(
- builder: (_) => Scaffold(
- appBar: AppBar(title: const Text("Route Error")),
- body: Center(
- child: Text('No route defined for ${settings.name}'),
- ),
- ));
- }
- }
- }
|