123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'package:flutter/cupertino.dart';
- 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_page.dart';
- import 'package:flutter_tracker/pages/mine_page.dart';
- import 'package:flutter_tracker/pages/register_page.dart';
- import 'package:flutter_tracker/pages/submit_page.dart';
- import 'package:flutter_tracker/pages/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: (_) => IndexPage());
- break;
- case trackPage:
- return MaterialPageRoute(builder: (_) => TrackPage());
- break;
- case minePage:
- return MaterialPageRoute(builder: (_) => MinePage());
- break;
- case aboutPage:
- return MaterialPageRoute(builder: (_) => AboutPage());
- break;
- case helpPage:
- return MaterialPageRoute(builder: (_) => HelpPage());
- break;
- case loginPage:
- return MaterialPageRoute(builder: (_) => LoginPage());
- break;
- case registerPage:
- return MaterialPageRoute(builder: (_) => RegisterPage());
- break;
- case submitPage:
- return MaterialPageRoute(builder: (_) => SubmitPage());
- break;
- case welPage:
- return MaterialPageRoute(builder: (_) => WelComePage());
- break;
- default:
- return MaterialPageRoute(
- builder: (_) => Scaffold(
- appBar: AppBar(title: Text("Route Error")),
- body: Center(
- child: Text('No route defined for ${settings.name}'),
- ),
- ));
- }
- }
- }
|