119ba920
liangchengyou
feat:视频播放器
|
1
|
import 'package:flutter/material.dart';
|
46675a89
吴启风
feat:过渡页-视频环节
|
2
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
aa0d2360
吴启风
feat:过渡页-视频环节(再来一次)
|
3
|
import 'package:wow_english/pages/section/subsection/base_section/state.dart';
|
46675a89
吴启风
feat:过渡页-视频环节
|
4
|
import 'package:wow_english/pages/video/lookvideo/bloc/look_video_bloc.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
5
|
import 'package:wow_english/pages/video/lookvideo/widgets/video_widget.dart';
|
1e22b7d1
吴启风
feat:儿歌/视频环节接口请求时机优化
|
6
|
import 'package:wow_english/utils/log_util.dart';
|
4b358e22
liangchengyou
feat:调整文件结构
|
7
|
|
46675a89
吴启风
feat:过渡页-视频环节
|
8
9
|
class LookVideoPage extends StatelessWidget {
const LookVideoPage(
|
1e22b7d1
吴启风
feat:儿歌/视频环节接口请求时机优化
|
10
11
12
13
14
|
{super.key,
this.videoUrl,
this.typeTitle,
this.courseLessonId,
this.isTopic = false});
|
993c1a04
liangchengyou
feat:添加数据模型
|
15
|
|
6baa39bd
吴启风
feat:儿歌/视频保留url传参...
|
16
|
///暂时不删,留着以后扩展。目前的逻辑是null,进入后请求课程数据
|
993c1a04
liangchengyou
feat:添加数据模型
|
17
|
final String? videoUrl;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
18
|
final String? typeTitle;
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
19
|
final String? courseLessonId;
|
46675a89
吴启风
feat:过渡页-视频环节
|
20
|
final bool isTopic;
|
119ba920
liangchengyou
feat:视频播放器
|
21
22
|
@override
|
119ba920
liangchengyou
feat:视频播放器
|
23
|
Widget build(BuildContext context) {
|
46675a89
吴启风
feat:过渡页-视频环节
|
24
|
return BlocProvider(
|
1e22b7d1
吴启风
feat:儿歌/视频环节接口请求时机优化
|
25
26
27
|
create: (BuildContext context) =>
LookVideoBloc(videoUrl, typeTitle, courseLessonId, isTopic)
..add(RequestDataEvent()),
|
46675a89
吴启风
feat:过渡页-视频环节
|
28
|
child: Builder(builder: (context) => _buildPage(context)),
|
119ba920
liangchengyou
feat:视频播放器
|
29
30
|
);
}
|
46675a89
吴启风
feat:过渡页-视频环节
|
31
32
33
|
}
Widget _buildPage(BuildContext context) {
|
1e22b7d1
吴启风
feat:儿歌/视频环节接口请求时机优化
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
return BlocBuilder<LookVideoBloc, BaseSectionState>(
builder: (context, state) {
final bloc = BlocProvider.of<LookVideoBloc>(context);
Log.d("WQF lookvideo BlocBuilder bloc.videoUr=${bloc.videoUrl}");
return Center(
child: bloc.videoUrl?.isNotEmpty == true
? Container(
color: Colors.white,
child: VideoWidget(
videoUrl: bloc.videoUrl ?? '',
typeTitle: bloc.typeTitle ?? '',
courseLessonId: bloc.courseLessonId ?? '',
isTopic: bloc.isTopic,
))
//todo 空了需要抽一个通用的loading组件
: Container(
color: Colors.white,
child: const CircularProgressIndicator(),
),
);
});
|
46675a89
吴启风
feat:过渡页-视频环节
|
55
|
}
|