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
bfc70b22
Commit
bfc70b22
authored
Feb 14, 2023
by
NguyenTienManh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 14-2
parent
1ddc347c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
42 deletions
+90
-42
lib/app/module/course/widgets/course_widget.dart
lib/app/module/course/widgets/course_widget.dart
+1
-0
lib/app/module/coursedetail/widgets/course_detail.dart
lib/app/module/coursedetail/widgets/course_detail.dart
+36
-13
lib/app/module/lession/widgets/lession_widget.dart
lib/app/module/lession/widgets/lession_widget.dart
+47
-25
lib/app/module/school/widgets/school_widget.dart
lib/app/module/school/widgets/school_widget.dart
+1
-0
lib/app/ui/navigationbottom/home_page.dart
lib/app/ui/navigationbottom/home_page.dart
+0
-1
lib/app/ui/search_page.dart
lib/app/ui/search_page.dart
+5
-3
No files found.
lib/app/module/course/widgets/course_widget.dart
View file @
bfc70b22
...
...
@@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import
'package:flutter_swiper_view/flutter_swiper_view.dart'
;
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../bloc/course_bloc.dart'
;
...
...
lib/app/module/coursedetail/widgets/course_detail.dart
View file @
bfc70b22
...
...
@@ -5,9 +5,10 @@ import 'package:ongbut_ntmanh/app/module/coursedetail/model/chapters.dart';
import
'package:ongbut_ntmanh/app/module/coursedetail/model/course_detail_model.dart'
;
import
'package:ongbut_ntmanh/app/module/lession/widgets/lession_widget.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'package:ongbut_ntmanh/widgets/widgets_util.dart'
;
import
'../bloc/course_detail_bloc.dart'
;
// dang loi
class
CourseDetailWidget
extends
StatelessWidget
{
String
courseId
;
String
image
;
...
...
@@ -26,12 +27,13 @@ class CourseDetailWidget extends StatelessWidget {
appBar:
AppBar
(
title:
const
Text
(
'Chi Tiet Khoa Hoc'
),),
body:
Column
(
children:
[
Image
.
network
(
image
!=
null
?
image:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
,
fit:
BoxFit
.
fill
,
height:
200
,
width:
double
.
maxFinite
,),
Image
.
network
(
image
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
,
width:
double
.
maxFinite
,),
Row
(
children:
[
Text
(
'ID Course = '
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
)),
Text
(
courseId
),
],
),
BlocConsumer
<
CourseDetailBloc
,
CourseDetailState
>(
...
...
@@ -50,20 +52,41 @@ class CourseDetailWidget extends StatelessWidget {
return
const
CircularProgressIndicator
();
}
if
(
state
is
CourseDetailSuccess
){
// Image.network('https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG',
// fit: BoxFit.fill,height: 200,width: double.maxFinite,);
chapters
=
state
.
courseDetailModel
.
data
!.
chapters
!;
if
(
chapters
.
isEmpty
==
true
){
if
(
chapters
.
isEmpty
){
return
const
Text
(
'Chua Co Noi Dung Khoa Hoc'
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
),);
}
if
(
chapters
.
is
Empty
==
false
){
if
(
chapters
.
is
NotEmpty
){
return
Column
(
children:
[
// Image.network(image!=null?image:'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG',
// fit: BoxFit.fill,height: 200,width: double.maxFinite,),
LessionWidget
(
chapters
[
0
].
listLesson
![
0
].
lessonId
!=
null
?
chapters
[
0
].
listLesson
![
0
].
lessonId
!:
'fb228efa-7b32-419e-98b4-a6d5135f4361'
),
],);
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
0
,
0
),
child:
Row
(
children:
[
const
Text
(
'Thong Tin chi tiet'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),),
const
SizedBox
(
width:
100
),
TextButton
(
child:
Text
(
'Nhan xet ve khoa hoc'
),
onPressed:
()
{
print
(
'Pressed'
);
}
)
],
),
),
Text
(
chapters
[
0
].
name
!),
Text
(
chapters
[
0
].
listLesson
![
0
].
name
!),
Text
(
chapters
[
0
].
listLesson
![
0
].
createUser
!),
Text
(
chapters
[
0
].
listLesson
![
0
].
listPart
![
0
].
partType
!),
LessionWidget
(
chapters
[
0
].
listLesson
![
0
].
lessonId
!=
null
?
chapters
[
0
].
listLesson
![
0
].
lessonId
!:
'fb228efa-7b32-419e-98b4-a6d5135f4361'
),
],),
);
}
}
return
const
Text
(
'Default CourseDetail!!!!!'
);
...
...
lib/app/module/lession/widgets/lession_widget.dart
View file @
bfc70b22
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'../../../../const/colors.dart'
;
import
'../../playvideo/page/play_video.dart'
;
import
'../bloc/lesson_bloc.dart'
;
import
'../model/lesson_model.dart'
;
...
...
@@ -30,22 +31,28 @@ class _LessionWidgetState extends State<LessionWidget> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
widget
.
lessonID
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
0
,
0
),
child:
Row
(
children:
[
const
Text
(
'Thong Tin chi tiet'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),),
const
SizedBox
(
width:
100
),
TextButton
(
child:
Text
(
'Nhan xet ve khoa hoc'
),
onPressed:
()
{
print
(
'Pressed'
);
}
)
],
),
Row
(
children:
[
Text
(
'ID Lesson = '
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
)),
Text
(
widget
.
lessonID
),
],
),
// Padding(
// padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
// child: Row(
// children: [
// const Text('Thong Tin chi tiet',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 15),),
// const SizedBox(width: 100),
// TextButton(
// child: Text('Nhan xet ve khoa hoc'),
// onPressed: () {
// print('Pressed');
// }
// )
// ],
// ),
// ),
BlocConsumer
<
LessonBloc
,
LessonState
>(
listener:
(
context
,
state
)
async
{},
builder:
(
context
,
state
)
{
...
...
@@ -64,15 +71,30 @@ class _LessionWidgetState extends State<LessionWidget> {
}
if
(
state
is
LessonSuccess
){
return
// const Text('LessonSuccess');
// Column(children: [
// Text(state.lessonModel.data![2].title!=null?state.lessonModel.data![2].title!:'khong co Video'),
// //Text(state.lessonModel.data![index].playlist![0]!=null?state.lessonModel.data![index].playlist![0].link!:'....'),
// TextButton(
// onPressed: (){
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => PlayVideoPage(link: state.lessonModel.data![2].playlist![0].link!)),
// );
// },
// child:
// Text(state.lessonModel.data![2].title == pl ?state.lessonModel.data![2].playlist![0].link!:'...'),
// // Text(state.lessonModel.data![index].playlist![0]!=null?state.lessonModel.data![index].playlist![0].link!:'....'),
// ),
// ],);
ListView
.
builder
(
shrinkWrap:
true
,
itemCount:
state
.
lessonModel
.
data
!.
length
,
itemBuilder:
(
context
,
index
){
return
Column
(
children:
[
Text
(
state
.
lessonModel
.
data
![
index
].
title
!=
null
?
state
.
lessonModel
.
data
![
index
].
title
!:
'khong co du lieu'
),
//
Text(state.lessonModel.data![index].title!=null?state.lessonModel.data![index].title!:'khong co du lieu'),
//Text(state.lessonModel.data![index].playlist![0]!=null?state.lessonModel.data![index].playlist![0].link!:'....'),
TextButton
(
onPressed:
(){
Navigator
.
push
(
...
...
@@ -100,12 +122,12 @@ class _LessionWidgetState extends State<LessionWidget> {
}
onPressHander
()
{
setState
(()
{
Container
(
height:
200
,
width:
200
,
child:
const
Text
(
'111111'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
30
),));
});
}
//
onPressHander() {
//
setState(() {
//
Container(
//
height: 200,
//
width: 200,
//
child: const Text('111111',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 30),));
//
});
//
}
}
lib/app/module/school/widgets/school_widget.dart
View file @
bfc70b22
...
...
@@ -5,6 +5,7 @@ import 'package:flutter_swiper_view/flutter_swiper_view.dart';
import
'package:ongbut_ntmanh/app/module/coursedetail/model/course_detail_model.dart'
;
import
'package:ongbut_ntmanh/app/module/school/model/list_data.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../bloc/school_bloc.dart'
;
...
...
lib/app/ui/navigationbottom/home_page.dart
View file @
bfc70b22
...
...
@@ -27,7 +27,6 @@ import '../search_page.dart';
class
HomePage
extends
StatefulWidget
{
HomePage
({
Key
?
key
})
:
super
(
key:
key
);
CommentModel
?
commentModel
;
@override
State
<
HomePage
>
createState
()
=>
_HomePageState
();
...
...
lib/app/ui/search_page.dart
View file @
bfc70b22
...
...
@@ -78,9 +78,11 @@ Widget _courseList( listData, BuildContext context) {
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
CourseDetailWidget
(
listData
.
courseId
!,
listData
.
image
!=
null
?
listData
.
image
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
),
)).
then
((
value
)
{
if
(
value
!=
null
&&
value
is
bool
&&
value
)
{}
});
)
);
// .then((value) {
// if (value != null && value is bool && value) {}
// });
},
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
15
,
10
,
15
,
10
),
...
...
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