123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- // splash 页面
- import 'dart:convert';
- import 'package:fluro/fluro.dart';
- import 'package:flutter/material.dart';
- import 'package:sport/bean/post.dart';
- import 'package:sport/bean/post_user.dart';
- import 'package:sport/bean/game.dart';
- import 'package:sport/bean/rank_game_info.dart';
- import 'package:sport/bean/user.dart';
- import 'package:sport/pages/game/game_detail.dart';
- import 'package:sport/pages/game/rank_detail.dart';
- import 'package:sport/pages/game/rank_introduce.dart';
- import 'package:sport/pages/game/rank_people_detail.dart';
- import 'package:sport/pages/home/duration_page.dart';
- import 'package:sport/pages/home/duration_setting_page.dart';
- import 'package:sport/pages/home/sport_detail_page.dart';
- import 'package:sport/pages/home/sport_history_page.dart';
- import 'package:sport/pages/home/target_modify_page.dart';
- import 'package:sport/pages/home_page.dart';
- import 'package:sport/pages/login/auth_code.dart';
- import 'package:sport/pages/login/basic.dart';
- import 'package:sport/pages/login/find_password.dart';
- import 'package:sport/pages/login/index.dart';
- import 'package:sport/pages/login/license.dart';
- import 'package:sport/pages/login/register.dart';
- import 'package:sport/pages/my/device_info_page.dart';
- import 'package:sport/pages/my/user_info_page.dart';
- import 'package:sport/pages/setting/account_page.dart';
- import 'package:sport/pages/setting/message_setting_page.dart';
- import 'package:sport/pages/setting/privacypolicy_page.dart';
- import 'package:sport/pages/setting/serviceagreement_page.dart';
- import 'package:sport/pages/setting/setting_page.dart';
- import 'package:sport/pages/social/post_detail_page.dart';
- import 'package:sport/pages/social/post_page.dart';
- import 'package:sport/pages/social/social_detail_page.dart';
- import 'package:sport/pages/social/user_detail_page.dart';
- import 'package:sport/pages/splash_page.dart';
- import 'package:sport/pages/game/index.dart';
- import 'package:sport/bean/forum.dart';
- import 'package:sport/services/Converter.dart';
- var splashHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SplashPage();
- });
- var homeHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return HomePage();
- });
- // setting
- var settingHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SettingPage();
- });
- var privacypolicyHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return PrivacypolicyPage();
- });
- var serviceagreementHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return ServiceagreementPage();
- });
- var accountHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return AccountPage();
- });
- var messageSettingHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return MessageSettingPage();
- });
- var userInfoHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return UserInfoPage();
- });
- var deviceInfoHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return DeviceInfoPage();
- });
- // social
- var socialDetailHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SocialDetailPage(
- Forum.fromJson(json.decode(params['data']!.first.toString())),
- index: Converter.toInt(params['index']?.first ?? 0),
- );
- });
- var socialPostHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return PostPage(params['id']!.first.toString());
- });
- var socialPostDetailHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return PostDetailPage(Post.fromJson(json.decode(params['data']!.first.toString())),
- params['comment']?.first.toString() == "true", null);
- });
- var socialUserDetailHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return UserDetailPage(PostUser.fromJson(json.decode(params['data']!.first.toString())));
- });
- // home
- var sportDetailHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SportDetailPage();
- });
- var sportHistoryHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SportHistoryPage(
- GameInfoData.fromJson(json.decode(params['details']!.first.toString())));
- });
- var targetModifyHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- // return TargetModifyPage();
- return DurationSettingPage();
- });
- // game
- var gameIndexHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return GamePage();
- });
- var gameDetailsHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- // print(params['details'].first);
- return GameDetailsPage(
- GameInfoData.fromJson(json.decode(params['details']!.first.toString())));
- });
- var rankPeopleDetailsHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return RankPeopleDetailsPage(
- User.fromJson(json.decode(params['details']!.first.toString())));
- });
- var loginHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- if (params != null) {
- if (params.containsKey("type")) {
- return Login(Converter.toInt(params['type']!.first.toString()));
- }
- }
- return Login(1);
- });
- var licenseHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return SportLicensePage();
- });
- var authCodeHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return AuthCodePage(params['phone']!.first.toString());
- });
- var registerHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return RegisterPage();
- });
- var basicHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return BasicInfoPage(username: params['username']!.first.toString());
- });
- var findPasswordHandler = new Handler(
- handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
- return FindPasswordPage();
- });
|