Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ntManhBut
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NguyenTienManh
ntManhBut
Commits
bc980cbc
Commit
bc980cbc
authored
Feb 15, 2023
by
NguyenTienManh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 14-2
parent
68255175
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
59 deletions
+9
-59
lib/app/module/coursedetail/widgets/course_detail.dart
lib/app/module/coursedetail/widgets/course_detail.dart
+0
-1
lib/app/module/playvideo/page/play_video.dart
lib/app/module/playvideo/page/play_video.dart
+6
-55
lib/app/ui/search_page.dart
lib/app/ui/search_page.dart
+3
-3
No files found.
lib/app/module/coursedetail/widgets/course_detail.dart
View file @
bc980cbc
...
...
@@ -92,7 +92,6 @@ class CourseDetailWidget extends StatelessWidget {
physics:
const
AlwaysScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
return
// chapters[index].listLesson!.isNotEmpty?
ExpansionTile
(
title:
Text
(
chapters
[
index
].
name
!),
children:
[
...
...
lib/app/module/playvideo/page/play_video.dart
View file @
bc980cbc
...
...
@@ -3,33 +3,16 @@ import 'package:flutter/material.dart';
import
'package:flutter/services.dart'
;
import
'package:youtube_player_flutter/youtube_player_flutter.dart'
;
class
PlayVideoPage
extends
State
ful
Widget
{
class
PlayVideoPage
extends
State
less
Widget
{
String
link
;
PlayVideoPage
({
required
this
.
link
,
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
PlayVideoPage
>
createState
()
=>
_PlayVideoPageState
();
}
class
_PlayVideoPageState
extends
State
<
PlayVideoPage
>
{
late
YoutubePlayerController
_controller
;
// late TextEditingController _idController;
// late TextEditingController _seekToController;
// final List<String> _ids = [
// 'nPt8bK2gbaU',
// ];
@override
void
initState
()
{
super
.
initState
();
_controller
=
YoutubePlayerController
(
// initialVideoId: "nPt8bK2gbaU",
// initialVideoId: widget.link,
initialVideoId:
YoutubePlayer
.
convertUrlToId
(
widget
.
link
).
toString
(),
Widget
build
(
BuildContext
context
)
{
_controller
=
YoutubePlayerController
(
initialVideoId:
YoutubePlayer
.
convertUrlToId
(
link
).
toString
(),
flags:
const
YoutubePlayerFlags
(
mute:
false
,
autoPlay:
true
,
...
...
@@ -38,50 +21,18 @@ class _PlayVideoPageState extends State<PlayVideoPage> {
isLive:
false
,
forceHD:
false
,
enableCaption:
true
,
),
);
}
@override
void
deactivate
()
{
// Pauses video while navigating to next page.
_controller
.
pause
();
super
.
deactivate
();
}
@override
void
dispose
()
{
_controller
.
dispose
();
// _idController.dispose();
// _seekToController.dispose();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
YoutubePlayerBuilder
(
onExitFullScreen:
()
{
SystemChrome
.
setPreferredOrientations
(
DeviceOrientation
.
values
);
},
onExitFullScreen:
()
{
SystemChrome
.
setPreferredOrientations
(
DeviceOrientation
.
values
);},
player:
YoutubePlayer
(
controller:
_controller
,
showVideoProgressIndicator:
true
,
progressIndicatorColor:
Colors
.
blueAccent
,
// onReady: () {
// _isPlayerReady = true;
// },
// onEnded: (data) {
// _controller
// .load(_ids[(_ids.indexOf(data.videoId) + 1) % _ids.length]);
// },
),
builder:
(
context
,
player
)
=>
Scaffold
(
appBar:
AppBar
(
title:
Text
(
YoutubePlayer
.
convertUrlToId
(
widget
.
link
).
toString
()),),
appBar:
AppBar
(
title:
Text
(
YoutubePlayer
.
convertUrlToId
(
link
).
toString
()),),
body:
Container
(
child:
player
),
),
);
...
...
lib/app/ui/search_page.dart
View file @
bc980cbc
...
...
@@ -5,6 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'../../const/colors.dart'
;
import
'../../res/images/images.dart'
;
import
'../../widgets/widgets_util.dart'
;
import
'../module/course/bloc/course_bloc.dart'
;
import
'../module/course/model/course_model.dart'
;
import
'../module/coursedetail/widgets/course_detail.dart'
;
...
...
@@ -20,7 +21,7 @@ class SearchWidget extends StatelessWidget {
RequestCourse
(
context:
context
));
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'Tat ca cac khoa hoc'
),
),
appBar:
AppBar
(
title:
const
Text
(
'Tat ca cac khoa hoc'
)
),
body:
BlocBuilder
<
CourseBloc
,
CourseState
>(
builder:
(
context
,
state
)
{
...
...
@@ -107,8 +108,7 @@ Widget _courseList( listData, BuildContext context) {
StackTrace
?
stackTrace
)
{
return
Image
.
asset
(
Images
.
load_err
);
},
height:
130
,
// height: checkLandscape(context)?getHeight(context)*0.25:getHeight(context)*0.15,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.25
:
getHeight
(
context
)*
0.15
,
width:
double
.
maxFinite
,
),
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment