123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- import 'package:fluro/fluro.dart';
- import 'package:common_project/config/routers_path.dart';
- import 'package:common_project/utils/router_util/configure_routers.dart';
- import 'package:flutter/material.dart';
- import 'package:module_chat/chat_room_init.dart';
- import 'package:module_chat/text_page/chat_detail.dart';
- import 'package:module_chat/text_page/chat_init_page.dart';
- import 'package:module_chat/text_page/scal_animation.dart';
- import 'package:module_chat/text_page/text_animation.dart';
- import 'package:module_chat/view/chat_room_index_page.dart';
- import 'package:module_chat/view/child_view/chat_room_manager_child/chat_room_background_image_reset.dart';
- import 'package:module_chat/view/child_view/chat_room_manager_child/chat_room_manager_roomName.dart';
- import 'package:module_chat/view/child_view/chat_room_manager_role_list_page.dart';
- import 'package:module_chat/view/child_view/chat_room_manager_set.dart';
- import 'package:module_chat/view/child_view/chat_room_manager_set_adventure_page.dart';
- import 'package:module_chat/view/child_view/chat_room_online_user_page.dart';
- import 'package:module_chat/view/child_view/chat_room_report_page.dart';
- import 'package:module_chat/view/child_view/text_flu_page.dart';
- import 'package:common_project/common_project.dart';
- import 'package:module_chat/view/pk_child_view/chat_room_record_list_page.dart';
- import 'package:module_chat/view/room_gifts_page.dart';
- import 'dart:convert' show json;
- import 'package:module_chat/view/test_webview_game.dart';
- class ChatRouters with RouterPath{
- static String detail = '/detail';
- static String animation = "/animation";
- static String textClick ="/textClick";
- static String flu = "/flu";
- static String onlineuser = "/onlineuser";
- static String scal = "scal";
- static String loading = "loading";
- static String roomManagerSet = "roomManager";
- static String roomManagerInput = "managerInput";
- static String roomManageIamgeReset = "roomManageIamgeReset";
- static String roomManagerRoleListpage = "/roomManagerRoleListpage";
- static String roomManagerAdventurePage = "/roomManagerAdventurePage";
- static String pkRecordList = "pkRecordList";
- static String gifPage = "gifPage";
- static String reportPage = "reportPage";
- }
- class ModuleConfigRouters extends ConfigureRouters{
- @override
- void configureRouters(FluroRouter router) {
- // TODO: implement configureRouters
- router.define(ChatRouters.detail, handler:detailHandel);
- router.define(ChatRouters.animation, handler: textAnimationHandel);
- router.define(ChatRouters.textClick, handler: chatInitHandel);
- router.define(RouterPath().chatHome, handler: chatRoomIndexPageHandel);
- router.define(ChatRouters.onlineuser, handler: ChatRoomOnlineUserPageHandel);
- router.define(ChatRouters.scal, handler: ScalAnimationHandel);
- router.define(ChatRouters.roomManagerSet, handler: ChatRoomManagerSetHandel);
- router.define(ChatRouters.roomManagerInput, handler: ChatRoomManagerRoomNameHandel);
- router.define(ChatRouters.roomManageIamgeReset, handler: ChatRoomBackgroundImageManagerHandle);
- router.define(ChatRouters.roomManagerRoleListpage, handler: ChatRoomManagerRoleListPageHandle);
- router.define(ChatRouters.roomManagerAdventurePage, handler: ChatRoomManagerSetAdventurePageHandle);
- router.define(ChatRouters.pkRecordList, handler: ChatRoomRecordListPageHandle);
- router.define(ChatRouters.gifPage, handler: RoomGiftsHandle);
- router.define(ChatRouters.reportPage, handler: ChatRoomReportPageHandle);
- router.define(RouterPath().testWeb, handler: testWebPageHandel);
- }
- Handler detailHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- return ChatDetail();
- },
- );
- Handler chatInitHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- return ChatIndexPage();
- },
- );
- Handler textAnimationHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- // var reaource = parameters["resource"]?.first;
- return TextAnimation();
- },
- );
- Handler TextFluPageHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var reaource = parameters["data"]?.first;
- return TextFluPage(reaource as UserInfoData);
- },
- );
- Handler chatRoomIndexPageHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var roomId = parameters["roomId"]?.first;
- return ChatRoomIndexPage(roomId!);
- },
- );
- //在线用户, 必传两个参数 当前用户的角色, 和房间ID
- Handler ChatRoomOnlineUserPageHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var roomId = parameters["roomId"]?.first;
- var role = parameters["role"]?.first;
- return ChatRoomOnlineUserPage(roomId!,role!);
- },
- );
- Handler ScalAnimationHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var roomId = parameters["roomId"]?.first;
- var role = parameters["role"]?.first;
- return ScalAnimation();
- },
- );
- //loading 动画
- // Handler ChatRoomSvgLoadingHandel = Handler(
- // type: HandlerType.route,
- // handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- // return ChatRoomSvgLoading();
- // },
- // );
- Handler ChatRoomManagerSetHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- return ChatRoomManagerSet();
- },
- );
- Handler ChatRoomManagerRoomNameHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var title = parameters["title"]?.first;
- var des = parameters["des"]?.first;
- return ChatRoomManagerRoomName(title,des);
- },
- );
- Handler ChatRoomBackgroundImageManagerHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var title = parameters["title"]?.first;
- var des = parameters["des"]?.first;
- return ChatRoomBackgroundImageManager();
- },
- );
- //房间管理列表页面
- Handler ChatRoomManagerRoleListPageHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var roomId = parameters["roomId"]?.first;
- var roomRole = parameters["roomRole"]?.first;
- return ChatRoomManagerRoleListPage(roomId,roomRole);
- },
- );
- //大冒险配置
- Handler ChatRoomManagerSetAdventurePageHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- var roomId = parameters["roomId"]?.first;
- return ChatRoomManagerSetAdventurePage(roomId);
- },
- );
- //pk记录页面
- Handler ChatRoomRecordListPageHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- return ChatRoomRecordListPage();
- },
- );
- Handler RoomGiftsHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- String? roomId = parameters["roomId"]?.first;
- String? gifRoomSeats = parameters["gifRoomSeats"]?.first;
- return RoomGiftsPage(roomId,json.decode(gifRoomSeats!));
- },
- );
- Handler ChatRoomReportPageHandle = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- String? userId = parameters["userId"]?.first;
- return ChatRoomReportPage(userId);
- },
- );
- Handler testWebPageHandel = Handler(
- type: HandlerType.route,
- handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
- return TestWebviewGame();
- },
- );
- }
|