Room_Dialog_Util.dart 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. import 'package:flutter/material.dart';
  2. import 'package:common_project/common_project.dart';
  3. import 'package:module_chat/model/chat_room_facial_expression_model.dart';
  4. import 'package:module_chat/model/chat_room_gift_wall_model.dart';
  5. import 'package:module_chat/text_page/text_animation.dart';
  6. import 'package:module_chat/view/chat_room_bottom_item.dart';
  7. import 'package:module_chat/view/child_view/chat_room_bottom_heart_value_list_page.dart';
  8. import 'package:module_chat/view/child_view/chat_room_bottom_menu.dart';
  9. import 'package:module_chat/view/child_view/chat_room_bottom_seat_income_list_page.dart';
  10. import 'package:module_chat/view/child_view/chat_room_expression_page.dart';
  11. import 'package:module_chat/view/child_view/chat_room_gift_wall_page.dart';
  12. import 'package:module_chat/view/child_view/chat_room_hour_page.dart';
  13. import 'package:module_chat/view/child_view/chat_room_online_user_page.dart';
  14. import 'package:module_chat/view/child_view/chat_room_send_message.dart';
  15. import 'package:module_chat/view/child_view/chat_room_top_more.dart';
  16. import 'package:module_chat/view/child_view/room_person_detail_page.dart';
  17. import 'package:module_chat/view/child_view/seat_sheet_with_titles_page.dart';
  18. import 'package:module_chat/view/pk_child_view/chat_roo_pk_invite_page.dart';
  19. import 'package:module_chat/view/pk_child_view/chat_room_banner_combo_animation.dart';
  20. import 'package:module_chat/view/pk_child_view/chat_room_combo_alert.dart';
  21. import 'package:module_chat/view/pk_child_view/chat_room_cross_pk/chat_room_kf_match_page.dart';
  22. import 'package:module_chat/view/pk_child_view/chat_room_cross_pk/chat_room_kf_pk_masking_page.dart';
  23. import 'package:module_chat/view/pk_child_view/chat_room_cross_pk/chat_room_kf_start_pk_page.dart';
  24. import 'package:module_chat/view/pk_child_view/chat_room_pk_index_page.dart';
  25. import 'package:module_chat/view/pk_child_view/chat_room_pk_masking_page.dart';
  26. import 'package:module_chat/view/pk_child_view/chat_room_pk_mvp_mask_page.dart';
  27. import 'package:module_chat/view/pk_child_view/chat_room_pk_progress.dart';
  28. import 'package:module_chat/view/pk_child_view/chat_room_record_list_page.dart';
  29. import 'package:module_chat/view/pk_child_view/chat_room_start_pk_page.dart';
  30. import 'package:module_im/view/message_list_page.dart';
  31. import 'child_view/request_queue_page.dart';
  32. /**
  33. * des: 房间弹出框工具类
  34. */
  35. class RoomDialogUtil {
  36. //麦序等待页面
  37. static showRequestQueueWidget(BuildContext context, String roomId, bool isJoinQueue, bool isManager, Function func, Function removeQueue){
  38. DialogAddWidget(
  39. context: context,
  40. gravity: Gravity.bottom,
  41. decoration: BoxDecoration(
  42. color: Colors.transparent
  43. ),
  44. borderRadius: 0.0,
  45. barrierColor: Colors.transparent,
  46. backgroundColor: Colors.transparent,
  47. widget: RequestQueuePage(roomId, isJoinQueue,isManager, func, removeQueue)
  48. );
  49. }
  50. //弹出个人资料页面
  51. static void showRoomUserInfoDia(BuildContext context, String userId,List<String>? titles, Function(String, BuildContext, String,) func, bool showManager,{Function? managerClick}) async {
  52. TimiUserInfo model = await PublicApi.getUserInfo(userId: userId);
  53. if (model.success == true && model.data != null){
  54. DialogAddWidget(
  55. context: context,
  56. gravity: Gravity.bottom,
  57. decoration: BoxDecoration(
  58. color: Colors.transparent
  59. ),
  60. borderRadius: 0.0,
  61. barrierColor: Colors.transparent,
  62. backgroundColor: Colors.transparent,
  63. widget: RoomPersonDetailPage(model.data,titles, func, showManager,managerClick: managerClick,)
  64. );
  65. }
  66. }
  67. //弹出麦位操作框
  68. static void showSeatSheetView(BuildContext context,List<String> titles,Function(String) func, String numStr){
  69. DialogAddWidget(
  70. context: context,
  71. gravity: Gravity.bottom,
  72. decoration: BoxDecoration(
  73. color: Colors.transparent
  74. ),
  75. borderRadius: 0.0,
  76. barrierColor: Colors.black.withOpacity(0.5),
  77. backgroundColor: Colors.black.withOpacity(0.5),
  78. widget: SeatSheetWithTitlesPage(func,titles, numStr)
  79. );
  80. }
  81. //小时榜弹框
  82. static void showHourPge(BuildContext context){
  83. DialogAddWidget(
  84. context: context,
  85. gravity: Gravity.right,
  86. decoration: BoxDecoration(
  87. color: Colors.transparent
  88. ),
  89. borderRadius: 0.0,
  90. barrierColor: Colors.transparent,
  91. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  92. widget: ChatRoomHourPage()
  93. );
  94. }
  95. static void showChatRoomBottomMenu(BuildContext context,List<ManageBottomItem> items, Function(ChatRoomMenuType) func){
  96. DialogAddWidget(
  97. context: context,
  98. gravity: Gravity.bottom,
  99. decoration: BoxDecoration(
  100. color: Colors.transparent
  101. ),
  102. borderRadius: 0.0,
  103. barrierColor: Colors.transparent,
  104. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  105. widget: ChatRoomBottomMenu(func,items)
  106. );
  107. }
  108. static void showMorePage(BuildContext context, Function(String) func){
  109. DialogAddWidget(
  110. context: context,
  111. gravity: Gravity.top,
  112. decoration: BoxDecoration(
  113. color: Colors.transparent
  114. ),
  115. borderRadius: 0.0,
  116. barrierColor: Colors.transparent,
  117. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  118. widget: ChatRoomTopMore(func)
  119. );
  120. }
  121. //弹出发送消息的弹框
  122. static void showSendMessagepag(BuildContext context,TextInputType inputType, Function(String) func, String placeContent){
  123. showModalBottomSheet(
  124. barrierColor: Colors.transparent,
  125. isScrollControlled: true,
  126. context: context, builder:(BuildContext context){
  127. return ChatRoomSendMessage(inputType,func, placeContent);
  128. });
  129. }
  130. //弹出表情弹框
  131. static void showExpressionPage(BuildContext context, Function(int) func, List<List<ExpItem>> list ){
  132. showModalBottomSheet(
  133. barrierColor: Colors.transparent,
  134. isScrollControlled: true,
  135. context: context, builder:(BuildContext context){
  136. return ChatRoomExpressionPage(func,list);
  137. });
  138. }
  139. //弹出在线用户
  140. static void showOnLineUsers(BuildContext context, String userRole,String roomId){
  141. DialogAddWidget(
  142. context: context,
  143. gravity: Gravity.top,
  144. decoration: BoxDecoration(
  145. color: Colors.transparent
  146. ),
  147. borderRadius: 0.0,
  148. barrierColor: Colors.transparent,
  149. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  150. widget: ChatRoomOnlineUserPage(roomId,userRole)
  151. );
  152. }
  153. //弹出上麦框
  154. static void showOnMic(BuildContext context, Function(String) func){
  155. DialogAddWidget(
  156. context: context,
  157. gravity: Gravity.bottom,
  158. decoration: BoxDecoration(
  159. color: Colors.transparent
  160. ),
  161. borderRadius: 0.0,
  162. barrierColor: Colors.transparent,
  163. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  164. widget: Container(
  165. color: Colors.black.withOpacity(0.1),
  166. width: Sizes.width,
  167. margin: EdgeInsets.only(bottom: Sizes.bottomSafeHeight),
  168. child: Column(
  169. children: [
  170. Container(
  171. width: Sizes.width - 40.w,
  172. decoration: BoxDecoration(
  173. color: Colors.white,
  174. borderRadius: BorderRadius.all(Radius.circular(20.w))
  175. ),
  176. child: Column(
  177. children:
  178. ["1","2","3","4","5","6","7","8"].map((e) {
  179. return InkWell(
  180. child: Column(
  181. children: [
  182. Container(
  183. margin: EdgeInsets.symmetric(vertical: 10.h),
  184. height: 55.h,
  185. alignment: Alignment.center,
  186. child: Text("上${e}号麦",style: TextStyle(fontSize: Sizes.fs_30,color: Colors.blue,fontWeight: FontWeight.w600),),
  187. ),
  188. e != "8"?Container(height: 1.h,margin: EdgeInsets.symmetric(vertical: 10.h),color: HexColor.fromHex("#f0f0f0"),):Container()
  189. ],
  190. ),
  191. onTap: (){
  192. Navigator.pop(context);
  193. func(e);
  194. },
  195. );
  196. }).toList()
  197. ),),
  198. InkWell(
  199. child: Container(
  200. margin: EdgeInsets.only(top: 20.h,bottom: 40.h,left: 20.w,right: 20.w),
  201. height: 88.h,
  202. alignment: Alignment.center,
  203. child: Text("取消",style: TextStyle(fontSize: Sizes.fs_30,color: Colors.blue,fontWeight: FontWeight.w600),),
  204. decoration: BoxDecoration(
  205. borderRadius: BorderRadius.all(Radius.circular(20.w)),
  206. color: Colors.white,
  207. ),
  208. ),
  209. onTap: (){
  210. Navigator.pop(context);
  211. },
  212. )
  213. ],
  214. ),
  215. )
  216. );
  217. }
  218. static void showCountDownDialogWidget(BuildContext context, Function(int) function){
  219. DialogAddWidget(
  220. context: context,
  221. gravity: Gravity.bottom,
  222. decoration: BoxDecoration(
  223. color: Colors.transparent
  224. ),
  225. borderRadius: 0.0,
  226. barrierColor: Colors.transparent,
  227. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  228. widget: Container(
  229. margin: EdgeInsets.only(bottom: Sizes.bottomSafeHeight),
  230. child: Column(
  231. children: [
  232. Container(
  233. width: Sizes.width - 40.w,
  234. decoration: BoxDecoration(
  235. color: Colors.white,
  236. borderRadius: BorderRadius.all(Radius.circular(20.w))
  237. ),
  238. child: Column(
  239. children:
  240. ["30秒","1分钟","2分钟","5分钟"].map((e) {
  241. return InkWell(
  242. child: Column(
  243. children: [
  244. Container(
  245. margin: EdgeInsets.symmetric(vertical: 10.h),
  246. height: 88.h,
  247. alignment: Alignment.center,
  248. child: Text("${e}",style: TextStyle(fontSize: Sizes.fs_30,color: Colors.blue),),
  249. ),
  250. Container(height: 1.h,color: HexColor.fromHex("#f0f0f0"),)
  251. ],
  252. ),
  253. onTap: (){
  254. Navigator.pop(context);
  255. int time = 0;
  256. if(e == "30秒"){
  257. time = 30;
  258. } else if (e == "1分钟"){
  259. time = 60;
  260. } else if (e== "2分钟"){
  261. time = 120;
  262. } else if (e== "5分钟"){
  263. time = 300;
  264. }
  265. function(time);
  266. },
  267. );
  268. }).toList()
  269. ),),
  270. InkWell(
  271. child: Container(
  272. margin: EdgeInsets.only(top: 30.h,bottom: Sizes.bottomSafeHeight + 40.h),
  273. height: 88.h,
  274. width: Sizes.width - 40.w,
  275. alignment: Alignment.center,
  276. decoration: BoxDecoration(
  277. borderRadius: BorderRadius.all(Radius.circular(20.w)),color: Colors.white
  278. ),
  279. child: Text("取消",style: TextStyle(fontSize: Sizes.fs_30,color: Colors.blue),),),
  280. onTap: (){
  281. Navigator.pop(context);
  282. },
  283. )
  284. ],
  285. ),
  286. )
  287. );
  288. }
  289. //确认框
  290. static void showConfirmDialogWidget(BuildContext context,Function cancleFunc,Function confirmFunc,{String? title, String? subtitle, String? cancle,String? confirm}){
  291. DialogAddWidget(
  292. context: context,
  293. gravity: Gravity.center,
  294. decoration: BoxDecoration(
  295. color: Colors.transparent,
  296. ),
  297. borderRadius: 10.0,
  298. barrierColor: Colors.transparent,
  299. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  300. widget: Container(
  301. width: Sizes.width* 0.8,
  302. color: Colors.white,
  303. child: Column(
  304. children: [
  305. Container(
  306. margin: EdgeInsets.only(top: 22.h),
  307. height: 40.h,
  308. alignment: Alignment.center,
  309. child: Text("提示",style: TextStyle(fontWeight: FontWeight.w600),),),
  310. Container(
  311. alignment: Alignment.center,
  312. height: 40.h,
  313. child: Text("确认申请上麦吗?"),),
  314. SizedBox(height: 25.h,),
  315. Container(color: HexColor.fromHex("f0f0f0"),width: Sizes.width* 0.8,height: 1.h,),
  316. Container(
  317. height: 80.h,
  318. padding: EdgeInsets.symmetric(horizontal: 30.w),
  319. child: Row(
  320. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  321. children: [
  322. InkWell(
  323. child: Container(
  324. width: ((Sizes.width * 0.8)- 61.w)/2,
  325. alignment: Alignment.center,
  326. child: Text("我再想想",style: TextStyle(color: Colors.blue),),),
  327. onTap: (){
  328. Navigator.pop(context);
  329. cancleFunc();
  330. },
  331. ),
  332. Container(color: HexColor.fromHex("f0f0f0"),width: 1.w,height: 100.h,),
  333. InkWell(
  334. child: Container(
  335. alignment: Alignment.center,
  336. width: ((Sizes.width * 0.8)- 61.w)/2,
  337. child: Text("确认",style: TextStyle(color: Colors.blue),),),
  338. onTap: (){
  339. Navigator.pop(context);
  340. confirmFunc();
  341. },
  342. )
  343. ],),
  344. )
  345. ],
  346. ),
  347. )
  348. );
  349. }
  350. //设置聊天室锁
  351. static void showChatRoomLock(BuildContext context, Function(String) func){
  352. DialogAddWidget(
  353. context: context,
  354. gravity: Gravity.bottom,
  355. decoration: BoxDecoration(
  356. color: Colors.transparent
  357. ),
  358. borderRadius: 20.0,
  359. barrierColor: Colors.transparent,
  360. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  361. widget: ChatRoomLock(func)
  362. );
  363. }
  364. //弹出心动值列表
  365. static void showHeartValueListPage(BuildContext context, String roomId){
  366. DialogAddWidget(
  367. context: context,
  368. gravity: Gravity.bottom,
  369. decoration: BoxDecoration(
  370. color: Colors.transparent,
  371. ),
  372. borderRadius: 0.0,
  373. barrierColor: Colors.transparent,
  374. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  375. widget: ChatRoomBottomHeartValueListPage(roomId)
  376. );
  377. }
  378. static void showImWidget(BuildContext context){
  379. DialogAddWidget(
  380. context: context,
  381. gravity: Gravity.bottom,
  382. decoration: BoxDecoration(
  383. color: Colors.transparent,
  384. ),
  385. borderRadius: 10.0,
  386. barrierColor: Colors.transparent,
  387. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  388. widget: Container(
  389. width: Sizes.width,
  390. height: 500.h,
  391. color: Colors.white,
  392. child: Column(
  393. children: [
  394. Container(
  395. margin: EdgeInsets.only(top: 10.h),
  396. child: Text("消息",style: TextStyle(fontSize: Sizes.fs_36,fontWeight: FontWeight.w600),),),
  397. Expanded(child: MessageListPage())
  398. ],
  399. ),
  400. )
  401. );
  402. }
  403. //麦位收益
  404. static void showSeatIncome(BuildContext context, String roomId){
  405. DialogAddWidget(
  406. context: context,
  407. gravity: Gravity.bottom,
  408. decoration: BoxDecoration(
  409. color: Colors.transparent,
  410. ),
  411. borderRadius: 10.0,
  412. barrierColor: Colors.transparent,
  413. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  414. widget: ChatRoomBottomSeatIncomeListPage(roomId)
  415. );
  416. }
  417. static void showWebViewPage(BuildContext context, String url){
  418. DialogAddWidget(
  419. context: context,
  420. gravity: Gravity.bottom,
  421. decoration: BoxDecoration(
  422. color: Colors.transparent,
  423. ),
  424. borderRadius: 10.0,
  425. barrierColor: Colors.transparent,
  426. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  427. widget: Container(
  428. height: Sizes.height,
  429. child: ChatRoomWebViewPage(url),
  430. width: Sizes.width,
  431. )
  432. );
  433. }
  434. //弹出甚至踢出时间, 设置主持人等弹框
  435. static void showCustomAlert(BuildContext context, List<String> items, Function(String) func) {
  436. DialogAddWidget(
  437. context: context,
  438. gravity: Gravity.bottom,
  439. decoration: BoxDecoration(
  440. color: Colors.transparent,
  441. ),
  442. borderRadius: 0.0,
  443. barrierColor: Colors.transparent,
  444. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  445. widget: Container(
  446. child: Column(children: [
  447. Container(
  448. margin: EdgeInsets.only(left: 30.w,right: 30.w),
  449. width: Sizes.width * 0.8,
  450. child: Column(
  451. children: items.map((e) {
  452. int index = items.indexOf(e);
  453. return Column(
  454. children: [
  455. InkWell(
  456. child: Container(
  457. color: Colors.white.withOpacity(0.1),
  458. height: 116.h,
  459. width: 300.w,
  460. alignment: Alignment.center,
  461. child: Text(e,style: TextStyle(fontSize: Sizes.fs_40,color: HexColor.fromHex("#007AFF")),),
  462. ),
  463. onTap: (){
  464. Navigator.pop(context);
  465. func(e);
  466. },
  467. ),
  468. index != items.length -1?Container(
  469. height: 1.h,
  470. color: HexColor.fromHex("#000000").withOpacity(0.4),
  471. ):Container()
  472. ],
  473. );
  474. }).toList(),
  475. ),
  476. decoration: BoxDecoration(
  477. borderRadius: BorderRadius.all(Radius.circular(20.w)),
  478. color: Colors.white
  479. ),
  480. ),
  481. Container(
  482. margin: EdgeInsets.only(top: 40.h,bottom: Sizes.bottomSafeHeight + 30.h,left: 40.w,right: 40.w),
  483. width: Sizes.width * 0.8,
  484. height: 116.h,
  485. decoration: BoxDecoration(
  486. borderRadius: BorderRadius.all(Radius.circular(20.w)),
  487. color: Colors.white,
  488. ),
  489. alignment: Alignment.center,
  490. child: Text("取消",style: TextStyle(fontSize: Sizes.fs_40,color: HexColor.fromHex("#007AFF")),),)
  491. ],),
  492. width: Sizes.width,
  493. )
  494. );
  495. }
  496. static void showPkIndexPage(BuildContext context,Function function){
  497. DialogAddWidget(
  498. context: context,
  499. gravity: Gravity.bottom,
  500. decoration: BoxDecoration(
  501. color: Colors.transparent,
  502. ),
  503. borderRadius: 0.0,
  504. barrierColor: Colors.transparent,
  505. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  506. widget: Container(
  507. child: ChatRoomPkIndexPage(),
  508. width: Sizes.width,
  509. )
  510. );
  511. }
  512. static void showInRoomPkPage(BuildContext context,bool pkState){
  513. DialogAddWidget(
  514. context: context,
  515. gravity: Gravity.rightBottom,
  516. decoration: BoxDecoration(
  517. color: Colors.transparent,
  518. ),
  519. borderRadius: 0.0,
  520. barrierColor: Colors.transparent,
  521. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  522. widget: Container(
  523. child: ChatRoomStartPkPage(pkState),
  524. width: Sizes.width,
  525. )
  526. );
  527. }
  528. //弹出pk记录
  529. static void showPKRecordPage(BuildContext context){
  530. DialogAddWidget(
  531. context: context,
  532. gravity: Gravity.rightBottom,
  533. decoration: BoxDecoration(
  534. color: Colors.transparent,
  535. ),
  536. borderRadius: 0.0,
  537. barrierColor: Colors.transparent,
  538. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  539. widget: Container(
  540. child: ChatRoomRecordListPage(),
  541. width: Sizes.width,
  542. )
  543. );
  544. }
  545. static void showKFRoomStartPage(BuildContext context){
  546. DialogAddWidget(
  547. context: context,
  548. gravity: Gravity.rightBottom,
  549. decoration: BoxDecoration(
  550. color: Colors.transparent,
  551. ),
  552. borderRadius: 0.0,
  553. barrierColor: Colors.transparent,
  554. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  555. widget: Container(
  556. child: ChatRoomKfStartPkPage(),
  557. width: Sizes.width,
  558. )
  559. );
  560. }
  561. //弹出跨房pk匹配页面
  562. static void showkfPkMathchPage(BuildContext context,bool kfpkState){
  563. DialogAddWidget(
  564. context: context,
  565. gravity: Gravity.rightBottom,
  566. decoration: BoxDecoration(
  567. color: Colors.transparent,
  568. ),
  569. borderRadius: 0.0,
  570. barrierColor: Colors.transparent,
  571. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  572. widget: Container(
  573. child: ChatRoomKfMatchPage(kfpkState),
  574. width: Sizes.width,
  575. )
  576. );
  577. }
  578. //pk结束弹框
  579. static void showPkStopAlert(BuildContext context, String pkTitle,Function confirm){
  580. DialogAddWidget(
  581. context: context,
  582. gravity: Gravity.center,
  583. decoration: BoxDecoration(
  584. color: Colors.transparent,
  585. ),
  586. borderRadius: 0.0,
  587. barrierDismissible: false,
  588. barrierColor: Colors.transparent,
  589. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  590. widget: Container(
  591. width: 560.w,
  592. height: 320.h,
  593. decoration: BoxDecoration(
  594. borderRadius: BorderRadius.all(Radius.circular(20.w)),
  595. color: Colors.white
  596. ),
  597. child: Column(
  598. children: [
  599. Container(
  600. margin: EdgeInsets.only(top: 48.h),
  601. child: Text("Pk正在进行中,是否关闭房间pk",style: TextStyle(fontSize: Sizes.fs_32,color: HexColor.fromHex("#1D1C1F").withOpacity(0.88)),),
  602. ),
  603. Container(
  604. margin: EdgeInsets.only(top: 16),
  605. child: Text("本轮PK主题:${pkTitle}",style: TextStyle(fontSize: Sizes.fs_24,color: HexColor.fromHex("#1D1C1F").withOpacity(0.4)),),
  606. ),
  607. Container(
  608. margin: EdgeInsets.only(top: 50.h),
  609. child: Row(
  610. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  611. children: [
  612. InkWell(
  613. child: Container(
  614. width: 232.w,
  615. height: 80.h,
  616. decoration: BoxDecoration(
  617. borderRadius: BorderRadius.all(Radius.circular(40.h)),
  618. color: HexColor.fromHex("#1D1C1F").withOpacity(0.04)
  619. ),
  620. alignment: Alignment.center,
  621. child: Text("取消",style: TextStyle(fontSize: Sizes.fs_28,color: HexColor.fromHex("#1D1C1F").withOpacity(0.88)),),
  622. ),
  623. onTap: (){
  624. Navigator.pop(context);
  625. },
  626. ),
  627. InkWell(
  628. child: Container(
  629. width: 232.w,
  630. height: 80.h,
  631. alignment: Alignment.center,
  632. decoration: BoxDecoration(
  633. gradient: LinearGradient(
  634. colors: [HexColor.fromHex("#7040FF"),HexColor.fromHex("#A080FF")],
  635. begin: Alignment.centerLeft,
  636. end: Alignment.centerRight
  637. ),
  638. borderRadius: BorderRadius.all(Radius.circular(40.h))
  639. ),
  640. child: Text("确定",style: TextStyle(fontSize: Sizes.fs_28,color: Colors.white),),
  641. ),
  642. onTap: (){
  643. Navigator.pop(context);
  644. confirm();
  645. },
  646. )
  647. ],
  648. ),
  649. )
  650. ],
  651. ),
  652. )
  653. );
  654. }
  655. //邀请弹框,
  656. /*
  657. title 邀请方的房间名
  658. agree 同意的方法回调
  659. */
  660. static void showInviteAlert(BuildContext context,String title, Function refuse,Function agree ,String targetRoomId){
  661. DialogAddWidget(
  662. context: context,
  663. gravity: Gravity.top,
  664. decoration: BoxDecoration(
  665. color: Colors.transparent,
  666. ),
  667. borderRadius: 0.0,
  668. barrierDismissible: false,
  669. barrierColor: Colors.transparent,
  670. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  671. widget: ChatRoomPkInvitePage(title, refuse, agree,targetRoomId)
  672. );
  673. }
  674. //弹出pk房蒙版
  675. static showPKMaskingPage(BuildContext context, BattleRoomIn? battleRoomIn){
  676. DialogAddWidget(
  677. context: context,
  678. gravity: Gravity.top,
  679. barrierDismissible: false,
  680. decoration: BoxDecoration(
  681. color: Colors.transparent,
  682. ),
  683. borderRadius: 0.0,
  684. barrierColor: Colors.transparent,
  685. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  686. widget: ChatRoomPkMaskingPage(battleRoomIn)
  687. );
  688. }
  689. static showPro(BuildContext context){
  690. DialogAddWidget(
  691. context: context,
  692. gravity: Gravity.top,
  693. decoration: BoxDecoration(
  694. color: Colors.transparent,
  695. ),
  696. borderRadius: 0.0,
  697. barrierColor: Colors.transparent,
  698. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  699. widget: ChatRoomPkProgress(12,12)
  700. );
  701. }
  702. static showKfMasking(BuildContext context){
  703. DialogAddWidget(
  704. context: context,
  705. gravity: Gravity.center,
  706. decoration: BoxDecoration(
  707. color: Colors.transparent,
  708. ),
  709. borderRadius: 0.0,
  710. barrierColor: Colors.transparent,
  711. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  712. widget: ChatRoomKfPkMaskingPage(ChatRoomManager.instance.battleRoomCross)
  713. );
  714. }
  715. //显示连击图标
  716. static showComboAlert(BuildContext context,int gifNumber){
  717. DialogAddWidget(
  718. context: context,
  719. gravity: Gravity.bottom,
  720. decoration: BoxDecoration(
  721. color: Colors.transparent,
  722. ),
  723. borderRadius: 0.0,
  724. barrierColor: Colors.transparent,
  725. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  726. widget: ChatRoomComboAlert(gifNumber)
  727. );
  728. }
  729. //显示连击弹幕
  730. //显示mvp蒙版
  731. static showMvpMaskPage(BuildContext context, BattelPersonInfo? mvpUser,List<BattelPersonInfo>? leftCampVip,List<BattelPersonInfo>? rightCampVip){
  732. DialogAddWidget(
  733. context: context,
  734. gravity: Gravity.center,
  735. decoration: BoxDecoration(
  736. color: Colors.transparent,
  737. ),
  738. borderRadius: 0.0,
  739. barrierColor: Colors.transparent,
  740. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  741. widget: ChatRoomPkMvpMaskPage(mvpUser,leftCampVip,rightCampVip)
  742. );
  743. }
  744. static showGiftWallPage(BuildContext context,int total,List<GiftWallItem> items, Function sendGifAction){
  745. DialogAddWidget(
  746. context: context,
  747. gravity: Gravity.bottom,
  748. decoration: BoxDecoration(
  749. color: Colors.transparent,
  750. ),
  751. borderRadius: 0.0,
  752. barrierColor: Colors.transparent,
  753. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  754. widget: ChatRoomGiftWallPage(total,items,sendGifAction)
  755. );
  756. }
  757. static showLightExpalinALert(BuildContext context){
  758. DialogAddWidget(
  759. context: context,
  760. gravity: Gravity.center,
  761. decoration: BoxDecoration(
  762. color: Colors.transparent,
  763. ),
  764. borderRadius: 15.0,
  765. barrierColor: Colors.transparent,
  766. backgroundColor: HexColor.fromHex('#000000').withOpacity(0.2),
  767. widget: Container(
  768. width: Sizes.width * 0.8,
  769. height: 300.h,
  770. color: Colors.white,
  771. child: Column(
  772. children: [
  773. Padding(
  774. padding: EdgeInsets.only(top: 20.h),
  775. child: Text("礼物点亮说明",style: TextStyle(fontSize: Sizes.fs_36,fontWeight: FontWeight.w500),),
  776. ),
  777. Padding(
  778. padding: EdgeInsets.only(left: 30.w,top: 10.h),
  779. child: Row(
  780. children: [
  781. Column(
  782. crossAxisAlignment: CrossAxisAlignment.start,
  783. children: [
  784. Text("1,如何帮他点亮礼物"),
  785. SizedBox(height: 8.h,),
  786. Text("赠送Ta还未获得过的礼物即可为Ta点亮")
  787. ],
  788. )
  789. ],
  790. ),
  791. ),
  792. InkWell(
  793. child: Container(
  794. height: 70.h,
  795. margin: EdgeInsets.only(left: 150.w,right: 150.w,top: 30.h),
  796. decoration: BoxDecoration(
  797. borderRadius: BorderRadius.all(Radius.circular(35.h)),
  798. gradient: LinearGradient(
  799. colors: [HexColor.fromHex("#5D26FF"),HexColor.fromHex("#8359FF")],
  800. begin: Alignment.centerLeft,
  801. end: Alignment.centerRight
  802. )
  803. ),
  804. alignment: Alignment.center,
  805. child: Text("我知道了",style: TextStyle(fontSize: Sizes.fs_32,color: Colors.white),),
  806. ),
  807. onTap: (){
  808. Navigator.pop(context);
  809. },
  810. )
  811. ],
  812. ),
  813. )
  814. );
  815. }
  816. }