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
06d48e47
Commit
06d48e47
authored
Feb 10, 2023
by
NguyenTienManh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ec9eaa9f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
27 deletions
+42
-27
lib/app/module/course/widgets/course_details.dart
lib/app/module/course/widgets/course_details.dart
+0
-0
lib/app/module/course/widgets/course_widget.dart
lib/app/module/course/widgets/course_widget.dart
+18
-11
lib/app/module/lession/widgets/lession_widget.dart
lib/app/module/lession/widgets/lession_widget.dart
+1
-1
lib/app/module/lession/widgets/play_video.dart
lib/app/module/lession/widgets/play_video.dart
+23
-13
lib/app/module/school/widgets/school_widget.dart
lib/app/module/school/widgets/school_widget.dart
+0
-1
lib/app/ui/navigationbottom/home_page.dart
lib/app/ui/navigationbottom/home_page.dart
+0
-1
No files found.
lib/app/module/course/widgets/course_details.dart
deleted
100644 → 0
View file @
ec9eaa9f
lib/app/module/course/widgets/course_widget.dart
View file @
06d48e47
...
...
@@ -7,6 +7,7 @@ import 'package:ongbut_ntmanh/const/colors.dart';
import
'../../../../res/images/images.dart'
;
import
'../../../../widgets/widgets_util.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../bloc/course_bloc.dart'
;
import
'../model/course_model.dart'
;
...
...
@@ -54,16 +55,14 @@ class CourseWidget extends StatelessWidget {
if
(
state
is
CourseSuccess
){
listData
=
state
.
courseModel
.
data
!.
listData
!;
return
//Text(listData.length.toString());
Swiper
(
itemHeight:
340
,
itemWidth:
checkLandscape
(
context
)?
getWidth
(
context
)*
1
:
getWidth
(
context
)*
1
,
itemWidth:
double
.
maxFinite
,
layout:
SwiperLayout
.
TINDER
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Container
(
height:
300
,
width:
300
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
...
...
@@ -75,6 +74,7 @@ class CourseWidget extends StatelessWidget {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
10
)),
),
child:
Column
(
children:
[
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8.0
),
child:
...
...
@@ -83,10 +83,8 @@ class CourseWidget extends StatelessWidget {
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
return
const
Text
(
'😢'
);
},
},
),
),
),
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
...
...
@@ -102,10 +100,19 @@ class CourseWidget extends StatelessWidget {
],),
);
},
itemCount:
listData
.
length
,
viewportFraction:
0.8
,
scale:
0.9
,
// state.courseModel.data!.listData!.length,
onTap:
(
index
){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
CourseDetailWidget
(
listData
[
index
].
courseId
!,
listData
[
index
].
image
!=
null
?
listData
[
index
].
image
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
),
)).
then
((
value
)
{
if
(
value
!=
null
&&
value
is
bool
&&
value
)
{}
});
},
);
}
...
...
lib/app/module/lession/widgets/lession_widget.dart
View file @
06d48e47
...
...
@@ -76,7 +76,7 @@ class _LessionWidgetState extends State<LessionWidget> {
onPressed:
(){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
PlayVideoPage
(
link:
state
.
lessonModel
.
data
![
index
].
title
!)),
MaterialPageRoute
(
builder:
(
context
)
=>
PlayVideoPage
(
link:
state
.
lessonModel
.
data
![
index
].
playlist
![
0
].
link
!)),
);
},
child:
...
...
lib/app/module/lession/widgets/play_video.dart
View file @
06d48e47
...
...
@@ -14,17 +14,25 @@ class PlayVideoPage extends StatefulWidget {
class
_PlayVideoPageState
extends
State
<
PlayVideoPage
>
{
late
YoutubePlayerController
_controller
;
late
TextEditingController
_idController
;
late
TextEditingController
_seekToController
;
final
List
<
String
>
_ids
=
[
'nPt8bK2gbaU'
,
];
// late TextEditingController _idController;
// late TextEditingController _seekToController;
// final List<String> _ids = [
// 'nPt8bK2gbaU',
// ];
@override
void
initState
()
{
super
.
initState
();
_controller
=
YoutubePlayerController
(
initialVideoId:
_ids
.
first
,
_controller
=
YoutubePlayerController
(
// initialVideoId: "nPt8bK2gbaU",
// initialVideoId: widget.link,
initialVideoId:
YoutubePlayer
.
convertUrlToId
(
widget
.
link
).
toString
(),
flags:
const
YoutubePlayerFlags
(
mute:
false
,
autoPlay:
true
,
...
...
@@ -33,6 +41,7 @@ class _PlayVideoPageState extends State<PlayVideoPage> {
isLive:
false
,
forceHD:
false
,
enableCaption:
true
,
),
);
}
...
...
@@ -49,14 +58,15 @@ class _PlayVideoPageState extends State<PlayVideoPage> {
@override
void
dispose
()
{
_controller
.
dispose
();
_idController
.
dispose
();
_seekToController
.
dispose
();
//
_idController.dispose();
//
_seekToController.dispose();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
YoutubePlayerBuilder
(
onExitFullScreen:
()
{
SystemChrome
.
setPreferredOrientations
(
DeviceOrientation
.
values
);
...
...
@@ -68,10 +78,10 @@ class _PlayVideoPageState extends State<PlayVideoPage> {
// onReady: () {
// _isPlayerReady = true;
// },
onEnded:
(
data
)
{
_controller
.
load
(
_ids
[(
_ids
.
indexOf
(
data
.
videoId
)
+
1
)
%
_ids
.
length
]);
},
//
onEnded: (data) {
//
_controller
//
.load(_ids[(_ids.indexOf(data.videoId) + 1) % _ids.length]);
//
},
),
builder:
(
context
,
player
)
=>
Scaffold
(
appBar:
AppBar
(),
...
...
lib/app/module/school/widgets/school_widget.dart
View file @
06d48e47
...
...
@@ -62,7 +62,6 @@ class SchoolWidget extends StatelessWidget {
listData
=
state
.
schoolModel
.
data
!.
listData
!;
onData
!(
listData
);
return
//Text(listData.length.toString());
Swiper
(
itemHeight:
340
,
itemWidth:
double
.
maxFinite
,
...
...
lib/app/ui/navigationbottom/home_page.dart
View file @
06d48e47
...
...
@@ -88,7 +88,6 @@ class _HomePageState extends State<HomePage> {
],),
),
CourseWidget
(),
// CourseDetailWidget(),
SchoolWidget
((
listData
)
{
print
(
listData
.
length
);
}),
...
...
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