Browse Source

视频详情bug更改;

订单详情数据异常更改
dart3
wurong 5 months ago
parent
commit
8dd7ee55c3
  1. 13
      lib/community/community_course.dart
  2. 32
      lib/community/community_view/class_details_video.dart
  3. 2
      lib/order/order_detail_page.dart

13
lib/community/community_course.dart

@ -55,9 +55,16 @@ class _CommunityCourse extends State<CommunityCourse>
setState(() {});
}
});
queryCourseBanner();
classListAsync();
collectionList();
if (apiService == null) {
SharedPreferences.getInstance().then((value) {
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
_onRefresh();
});
}
}
///banner

32
lib/community/community_view/class_details_video.dart

@ -31,9 +31,9 @@ class ClassDetailsVideo extends StatefulWidget {
}
class ClassDetailsVideoState extends State<ClassDetailsVideo> {
late VideoPlayerController videoPlayerController;
late ChewieController chewieAudioController;
late Chewie chewies;
VideoPlayerController? videoPlayerController;
ChewieController? chewieAudioController;
Chewie? chewies;
GlobalKey globalKey = GlobalKey();
double height = 0;
@ -60,14 +60,14 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
}
initVideo(videoUrl) async {
videoPlayerController.pause();
videoPlayerController.dispose();
videoPlayerController?.pause();
videoPlayerController?.dispose();
videoPlayerController = VideoPlayerController.networkUrl(
Uri.parse(videoUrl),
)..initialize().then((value) {
chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController,
aspectRatio: videoPlayerController.value.aspectRatio,
videoPlayerController: videoPlayerController!,
aspectRatio: videoPlayerController?.value.aspectRatio,
// aspectRatio: 1.44,
//
autoPlay: false,
@ -87,7 +87,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
//
autoInitialize: true,
);
chewieAudioController.addListener(_fullScreenListener);
chewieAudioController?.addListener(_fullScreenListener);
if (mounted) setState(() {});
});
}
@ -101,7 +101,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
),
color: Colors.black,
key: globalKey,
child: (videoPlayerController.value.isInitialized ?? false)
child: (videoPlayerController?.value.isInitialized ?? false)
? videoWidget(
MediaQuery.of(context).size.height,
(MediaQuery.of(context).size.height / 1.44) - 43,
@ -115,11 +115,11 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
void dispose() {
super.dispose();
chewieAudioController.pause();
chewieAudioController.dispose();
chewieAudioController?.pause();
chewieAudioController?.dispose();
videoPlayerController.pause();
videoPlayerController.dispose();
videoPlayerController?.pause();
videoPlayerController?.dispose();
}
Widget videoWidget(double width, double height, src) {
@ -137,7 +137,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
height: MediaQuery.of(context).size.width / 1.5,
// margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: chewies = Chewie(
controller: chewieAudioController,
controller: chewieAudioController!,
),
)
: Container(
@ -150,7 +150,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
onTap: () {
setState(() {
widget.changeShowImg?.call(false);
chewieAudioController.play();
chewieAudioController?.play();
});
},
child: Container(
@ -189,7 +189,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
}
Future<void> _fullScreenListener() async {
if (!chewieAudioController.isFullScreen) {
if (!(chewieAudioController?.isFullScreen ?? false)) {
Future.delayed(Duration(seconds: 1), () {
widget.exitFull?.call();
});

2
lib/order/order_detail_page.dart

@ -113,7 +113,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
refreshController.loadFailed();
});
if (baseData?.isSuccess ?? false) {
orderInfo = baseData!.data;
orderInfo = baseData?.data;
payStatus = orderInfo?.payStatus ?? 0;
orderStatus = orderInfo?.orderStatus ?? 0;
sendStatus = orderInfo?.sendStatus ?? 0;

Loading…
Cancel
Save