diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index 811c2199..02f5bdfd 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -4,6 +4,7 @@ import 'package:chewie/chewie.dart'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; @@ -395,9 +396,23 @@ class _ClassDetails extends State with WidgetsBindingObserver { }); } + bool tempDelayedFlag = false; + Future _fullScreenListener() async { - if (!chewieAudioController.isFullScreen) { - Future.delayed(Duration(seconds: 1), () {}); + if (!chewieAudioController.isFullScreen && !tempDelayedFlag) { + tempDelayedFlag = true; + SystemChrome.setPreferredOrientations( + [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); + setState(() {}); + SystemChrome.setPreferredOrientations( + [DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]); + Future.delayed(Duration(seconds: 1), () { + SystemChrome.setPreferredOrientations( + [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); + setState(() { + tempDelayedFlag = false; + }); + }); } } @@ -410,52 +425,50 @@ class _ClassDetails extends State with WidgetsBindingObserver { child: Stack(children: [ (chewieAudioController != null ? Container( - width: width, - height: height, - child: chewies = Chewie( - controller: chewieAudioController, - ), - ) + width: width, + height: height, + child: chewies = Chewie( + controller: chewieAudioController, + ), + ) : Container( - width: width, - height: height, - )), - if(isShowImg) - GestureDetector( - onTap: () { - setState(() { - isShowImg = false; - if(chewieAudioController != null) - chewieAudioController.play(); - }); - }, - child: Container( - width: width, - height: height, - color: Colors.black, - child: Stack( - children: [ - Center( - child: MImage( - src, - width:width, - height: height, - fit: BoxFit.fill, - errorSrc: "assets/image/default_2_1.png", - fadeSrc: "assets/image/default_2_1.png", + width: width, + height: height, + )), + if (isShowImg) + GestureDetector( + onTap: () { + setState(() { + isShowImg = false; + if (chewieAudioController != null) + chewieAudioController.play(); + }); + }, + child: Container( + width: width, + height: width / 7 * 6, + color: Colors.black, + child: Stack( + children: [ + Center( + child: MImage( + src, + fit: BoxFit.cover, + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), ), - ), - Center( - child: Icon( - Icons.play_circle_outline, - color: Colors.white, - size: 60, + Center( + child: Icon( + Icons.play_circle_outline, + color: Colors.white, + size: 60, + ), ), - ), - ], + ], + ), ), ), - ), ])); } @@ -501,7 +514,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { setState(() { chapterIndex = position; isShowImg = true; - if(chewieAudioController != null) + if (chewieAudioController != null) chewieAudioController.pause(); initVideo(chapterList[position].content.fileUrl); }); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 2a0157c5..1e58d9a6 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -333,7 +333,7 @@ class _Settlement extends State { "id": orderId, }, ); - Navigator.of(context).pop(); + // Navigator.of(context).pop(); } @override diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index a3bfcf92..47d25624 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -234,7 +234,7 @@ class _UnionPage extends State PreferredSize( preferredSize: Size(double.infinity, 52.h), child: Container( - padding: EdgeInsets.only(top: 20.h), + padding: EdgeInsets.only(top:15.h), color: Color(0xFFFAFAFA), child: ItemTitle( text: S.of(context).jingbilianmenghuiyuandian,