routers.dart 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. import 'package:fluro/fluro.dart';
  2. import 'package:common_project/config/routers_path.dart';
  3. import 'package:common_project/utils/router_util/configure_routers.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:module_chat/chat_room_init.dart';
  6. import 'package:module_chat/text_page/chat_detail.dart';
  7. import 'package:module_chat/text_page/chat_init_page.dart';
  8. import 'package:module_chat/text_page/scal_animation.dart';
  9. import 'package:module_chat/text_page/text_animation.dart';
  10. import 'package:module_chat/view/chat_room_index_page.dart';
  11. import 'package:module_chat/view/child_view/chat_room_manager_child/chat_room_background_image_reset.dart';
  12. import 'package:module_chat/view/child_view/chat_room_manager_child/chat_room_manager_roomName.dart';
  13. import 'package:module_chat/view/child_view/chat_room_manager_role_list_page.dart';
  14. import 'package:module_chat/view/child_view/chat_room_manager_set.dart';
  15. import 'package:module_chat/view/child_view/chat_room_manager_set_adventure_page.dart';
  16. import 'package:module_chat/view/child_view/chat_room_online_user_page.dart';
  17. import 'package:module_chat/view/child_view/chat_room_report_page.dart';
  18. import 'package:module_chat/view/child_view/text_flu_page.dart';
  19. import 'package:common_project/common_project.dart';
  20. import 'package:module_chat/view/pk_child_view/chat_room_record_list_page.dart';
  21. import 'package:module_chat/view/room_gifts_page.dart';
  22. import 'dart:convert' show json;
  23. import 'package:module_chat/view/test_webview_game.dart';
  24. class ChatRouters with RouterPath{
  25. static String detail = '/detail';
  26. static String animation = "/animation";
  27. static String textClick ="/textClick";
  28. static String flu = "/flu";
  29. static String onlineuser = "/onlineuser";
  30. static String scal = "scal";
  31. static String loading = "loading";
  32. static String roomManagerSet = "roomManager";
  33. static String roomManagerInput = "managerInput";
  34. static String roomManageIamgeReset = "roomManageIamgeReset";
  35. static String roomManagerRoleListpage = "/roomManagerRoleListpage";
  36. static String roomManagerAdventurePage = "/roomManagerAdventurePage";
  37. static String pkRecordList = "pkRecordList";
  38. static String gifPage = "gifPage";
  39. static String reportPage = "reportPage";
  40. }
  41. class ModuleConfigRouters extends ConfigureRouters{
  42. @override
  43. void configureRouters(FluroRouter router) {
  44. // TODO: implement configureRouters
  45. router.define(ChatRouters.detail, handler:detailHandel);
  46. router.define(ChatRouters.animation, handler: textAnimationHandel);
  47. router.define(ChatRouters.textClick, handler: chatInitHandel);
  48. router.define(RouterPath().chatHome, handler: chatRoomIndexPageHandel);
  49. router.define(ChatRouters.onlineuser, handler: ChatRoomOnlineUserPageHandel);
  50. router.define(ChatRouters.scal, handler: ScalAnimationHandel);
  51. router.define(ChatRouters.roomManagerSet, handler: ChatRoomManagerSetHandel);
  52. router.define(ChatRouters.roomManagerInput, handler: ChatRoomManagerRoomNameHandel);
  53. router.define(ChatRouters.roomManageIamgeReset, handler: ChatRoomBackgroundImageManagerHandle);
  54. router.define(ChatRouters.roomManagerRoleListpage, handler: ChatRoomManagerRoleListPageHandle);
  55. router.define(ChatRouters.roomManagerAdventurePage, handler: ChatRoomManagerSetAdventurePageHandle);
  56. router.define(ChatRouters.pkRecordList, handler: ChatRoomRecordListPageHandle);
  57. router.define(ChatRouters.gifPage, handler: RoomGiftsHandle);
  58. router.define(ChatRouters.reportPage, handler: ChatRoomReportPageHandle);
  59. router.define(RouterPath().testWeb, handler: testWebPageHandel);
  60. }
  61. Handler detailHandel = Handler(
  62. type: HandlerType.route,
  63. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  64. return ChatDetail();
  65. },
  66. );
  67. Handler chatInitHandel = Handler(
  68. type: HandlerType.route,
  69. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  70. return ChatIndexPage();
  71. },
  72. );
  73. Handler textAnimationHandel = Handler(
  74. type: HandlerType.route,
  75. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  76. // var reaource = parameters["resource"]?.first;
  77. return TextAnimation();
  78. },
  79. );
  80. Handler TextFluPageHandel = Handler(
  81. type: HandlerType.route,
  82. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  83. var reaource = parameters["data"]?.first;
  84. return TextFluPage(reaource as UserInfoData);
  85. },
  86. );
  87. Handler chatRoomIndexPageHandel = Handler(
  88. type: HandlerType.route,
  89. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  90. var roomId = parameters["roomId"]?.first;
  91. return ChatRoomIndexPage(roomId!);
  92. },
  93. );
  94. //在线用户, 必传两个参数 当前用户的角色, 和房间ID
  95. Handler ChatRoomOnlineUserPageHandel = Handler(
  96. type: HandlerType.route,
  97. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  98. var roomId = parameters["roomId"]?.first;
  99. var role = parameters["role"]?.first;
  100. return ChatRoomOnlineUserPage(roomId!,role!);
  101. },
  102. );
  103. Handler ScalAnimationHandel = Handler(
  104. type: HandlerType.route,
  105. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  106. var roomId = parameters["roomId"]?.first;
  107. var role = parameters["role"]?.first;
  108. return ScalAnimation();
  109. },
  110. );
  111. //loading 动画
  112. // Handler ChatRoomSvgLoadingHandel = Handler(
  113. // type: HandlerType.route,
  114. // handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  115. // return ChatRoomSvgLoading();
  116. // },
  117. // );
  118. Handler ChatRoomManagerSetHandel = Handler(
  119. type: HandlerType.route,
  120. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  121. return ChatRoomManagerSet();
  122. },
  123. );
  124. Handler ChatRoomManagerRoomNameHandel = Handler(
  125. type: HandlerType.route,
  126. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  127. var title = parameters["title"]?.first;
  128. var des = parameters["des"]?.first;
  129. return ChatRoomManagerRoomName(title,des);
  130. },
  131. );
  132. Handler ChatRoomBackgroundImageManagerHandle = Handler(
  133. type: HandlerType.route,
  134. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  135. var title = parameters["title"]?.first;
  136. var des = parameters["des"]?.first;
  137. return ChatRoomBackgroundImageManager();
  138. },
  139. );
  140. //房间管理列表页面
  141. Handler ChatRoomManagerRoleListPageHandle = Handler(
  142. type: HandlerType.route,
  143. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  144. var roomId = parameters["roomId"]?.first;
  145. var roomRole = parameters["roomRole"]?.first;
  146. return ChatRoomManagerRoleListPage(roomId,roomRole);
  147. },
  148. );
  149. //大冒险配置
  150. Handler ChatRoomManagerSetAdventurePageHandle = Handler(
  151. type: HandlerType.route,
  152. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  153. var roomId = parameters["roomId"]?.first;
  154. return ChatRoomManagerSetAdventurePage(roomId);
  155. },
  156. );
  157. //pk记录页面
  158. Handler ChatRoomRecordListPageHandle = Handler(
  159. type: HandlerType.route,
  160. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  161. return ChatRoomRecordListPage();
  162. },
  163. );
  164. Handler RoomGiftsHandle = Handler(
  165. type: HandlerType.route,
  166. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  167. String? roomId = parameters["roomId"]?.first;
  168. String? gifRoomSeats = parameters["gifRoomSeats"]?.first;
  169. return RoomGiftsPage(roomId,json.decode(gifRoomSeats!));
  170. },
  171. );
  172. Handler ChatRoomReportPageHandle = Handler(
  173. type: HandlerType.route,
  174. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  175. String? userId = parameters["userId"]?.first;
  176. return ChatRoomReportPage(userId);
  177. },
  178. );
  179. Handler testWebPageHandel = Handler(
  180. type: HandlerType.route,
  181. handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
  182. return TestWebviewGame();
  183. },
  184. );
  185. }