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
b7f4483b
Commit
b7f4483b
authored
Feb 14, 2023
by
NguyenTienManh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 14-2
parent
bfc70b22
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
188 additions
and
113 deletions
+188
-113
lib/app/module/comment/widgets/comment_widget.dart
lib/app/module/comment/widgets/comment_widget.dart
+7
-16
lib/app/module/course/request/course_request.dart
lib/app/module/course/request/course_request.dart
+3
-1
lib/app/module/course/widgets/course_widget.dart
lib/app/module/course/widgets/course_widget.dart
+6
-3
lib/app/module/coursedetail/widgets/course_detail.dart
lib/app/module/coursedetail/widgets/course_detail.dart
+81
-49
lib/app/module/new/widgets/new_widget.dart
lib/app/module/new/widgets/new_widget.dart
+9
-11
lib/app/module/school/widgets/school_widget.dart
lib/app/module/school/widgets/school_widget.dart
+5
-3
lib/app/ui/search_page.dart
lib/app/ui/search_page.dart
+77
-30
No files found.
lib/app/module/comment/widgets/comment_widget.dart
View file @
b7f4483b
...
@@ -112,15 +112,14 @@ class CommentWidget extends StatelessWidget {
...
@@ -112,15 +112,14 @@ class CommentWidget extends StatelessWidget {
)
)
],),
],),
),
),
Text
(
state
.
commentModel
.
data
![
index
].
course
Type
!
),
Text
(
state
.
commentModel
.
data
![
index
].
course
Keyword
!=
null
?
state
.
commentModel
.
data
![
index
].
courseKeyword
!:
'Null'
,
style:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
),
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
0
,
10
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
0
,
10
,
0
),
child:
Expanded
(
child:
child:
Text
(
state
.
commentModel
.
data
![
index
].
content
!,
style:
TextStyle
(
fontSize:
15
),
Text
(
state
.
commentModel
.
data
![
index
].
content
!=
null
?
state
.
commentModel
.
data
![
index
].
content
!:
'Null'
,
style:
const
TextStyle
(
fontSize:
15
),
softWrap:
false
,
softWrap:
false
,
maxLines:
4
,
maxLines:
4
,
overflow:
TextOverflow
.
ellipsis
),
overflow:
TextOverflow
.
ellipsis
),
),
),
),
],
],
);
);
...
@@ -134,9 +133,7 @@ class CommentWidget extends StatelessWidget {
...
@@ -134,9 +133,7 @@ class CommentWidget extends StatelessWidget {
children:
[
children:
[
Container
(
Container
(
padding:
const
EdgeInsets
.
all
(
10
),
padding:
const
EdgeInsets
.
all
(
10
),
child:
Center
(
child:
SmoothPageIndicator
(
child:
Center
(
child:
SmoothPageIndicator
(
controller:
_pageController
,
controller:
_pageController
,
count:
state
.
commentModel
.
data
!.
length
,
count:
state
.
commentModel
.
data
!.
length
,
effect:
const
WormEffect
(),
effect:
const
WormEffect
(),
onDotClicked:
(
index
)
=>
_pageController
.
animateToPage
(
index
,
duration:
const
Duration
(
milliseconds:
1
),
curve:
Curves
.
bounceOut
),
onDotClicked:
(
index
)
=>
_pageController
.
animateToPage
(
index
,
duration:
const
Duration
(
milliseconds:
1
),
curve:
Curves
.
bounceOut
),
...
@@ -144,12 +141,6 @@ class CommentWidget extends StatelessWidget {
...
@@ -144,12 +141,6 @@ class CommentWidget extends StatelessWidget {
),
),
],),
],),
],);
],);
// Column(
// children: [
// Text(state.commentModel.data![index].courseName!),
// //Text(state.commentModel.data![index].content!),
// ],
// );
},
},
onPageChanged:
(
int
index
)
{
onPageChanged:
(
int
index
)
{
...
...
lib/app/module/course/request/course_request.dart
View file @
b7f4483b
import
'package:dio/dio.dart'
;
import
'package:dio/dio.dart'
;
import
'../model/course_model.dart'
;
import
'../model/course_model.dart'
;
// https://imes-api.myitsol.com/api/v1/public/search-courses
// https://imes-api.myitsol.com/api/v1/public/courses/lesson-free?startRecord=0&size=10
class
RemoteCourse
{
class
RemoteCourse
{
Future
<
CourseModel
?>
getCourseModel
()
async
{
Future
<
CourseModel
?>
getCourseModel
()
async
{
var
dio
=
Dio
();
var
dio
=
Dio
();
String
url
=
(
"https://imes-api.myitsol.com/api/v1/public/
search-courses
"
);
String
url
=
(
"https://imes-api.myitsol.com/api/v1/public/
courses/lesson-free?startRecord=0&size=10
"
);
var
response
=
await
dio
.
get
(
url
);
var
response
=
await
dio
.
get
(
url
);
if
(
response
.
statusCode
==
200
){
if
(
response
.
statusCode
==
200
){
var
json
=
response
.
data
;
var
json
=
response
.
data
;
...
...
lib/app/module/course/widgets/course_widget.dart
View file @
b7f4483b
...
@@ -5,6 +5,7 @@ import 'package:flutter_swiper_view/flutter_swiper_view.dart';
...
@@ -5,6 +5,7 @@ import 'package:flutter_swiper_view/flutter_swiper_view.dart';
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'../../../../res/images/images.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../bloc/course_bloc.dart'
;
import
'../bloc/course_bloc.dart'
;
...
@@ -90,8 +91,9 @@ class CourseWidget extends StatelessWidget {
...
@@ -90,8 +91,9 @@ class CourseWidget extends StatelessWidget {
fit:
BoxFit
.
fill
,
height:
200
,
width:
double
.
maxFinite
,
fit:
BoxFit
.
fill
,
height:
200
,
width:
double
.
maxFinite
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
StackTrace
?
stackTrace
)
{
return
const
Text
(
'😢'
);
return
Image
.
asset
(
Images
.
load_err
);
},),
},
),
),
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
...
@@ -115,7 +117,8 @@ class CourseWidget extends StatelessWidget {
...
@@ -115,7 +117,8 @@ class CourseWidget extends StatelessWidget {
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
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'
),
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
)
{
)).
then
((
value
)
{
if
(
value
!=
null
&&
value
is
bool
&&
value
)
{}
if
(
value
!=
null
&&
value
is
bool
&&
value
)
{}
...
...
lib/app/module/coursedetail/widgets/course_detail.dart
View file @
b7f4483b
...
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
...
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:ongbut_ntmanh/app/module/coursedetail/model/chapters.dart'
;
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/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/const/colors.dart'
;
import
'package:ongbut_ntmanh/widgets/widgets_util.dart'
;
import
'package:ongbut_ntmanh/widgets/widgets_util.dart'
;
import
'../../../../res/images/images.dart'
;
import
'../bloc/course_detail_bloc.dart'
;
import
'../bloc/course_detail_bloc.dart'
;
// dang loi
// dang loi
...
@@ -27,72 +27,104 @@ class CourseDetailWidget extends StatelessWidget {
...
@@ -27,72 +27,104 @@ class CourseDetailWidget extends StatelessWidget {
appBar:
AppBar
(
title:
const
Text
(
'Chi Tiet Khoa Hoc'
),),
appBar:
AppBar
(
title:
const
Text
(
'Chi Tiet Khoa Hoc'
),),
body:
body:
Column
(
children:
[
Column
(
children:
[
Image
.
network
(
image
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
,
width:
double
.
maxFinite
,),
Image
.
network
(
image
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
,
width:
double
.
maxFinite
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
return
Image
.
asset
(
Images
.
load_err
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
,
width:
double
.
maxFinite
,);
},
),
Row
(
Row
(
children:
[
children:
[
Text
(
'ID Course = '
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
)),
const
Text
(
'ID Course = '
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
)),
Text
(
courseId
),
Text
(
courseId
),
],
],
),
),
BlocConsumer
<
CourseDetailBloc
,
CourseDetailState
>(
Expanded
(
listener:
(
context
,
state
)
async
{},
child:
BlocConsumer
<
CourseDetailBloc
,
CourseDetailState
>(
builder:
(
context
,
state
)
{
listener:
(
context
,
state
)
async
{},
return
builder:
(
context
,
state
)
{
BlocBuilder
<
CourseDetailBloc
,
CourseDetailState
>(
return
builder:
(
context
,
state
)
{
BlocBuilder
<
CourseDetailBloc
,
CourseDetailState
>(
if
(
state
is
CourseDetailInitial
){
builder:
(
context
,
state
)
{
return
const
Text
(
'SchoolInitial'
);
if
(
state
is
CourseDetailInitial
){
}
return
const
Text
(
'SchoolInitial'
);
if
(
state
is
CourseDetailFailed
){
}
return
Text
(
state
.
message
.
toString
());
if
(
state
is
CourseDetailFailed
){
}
return
Text
(
state
.
message
.
toString
());
if
(
state
is
CourseDetailLoading
){
return
const
CircularProgressIndicator
();
}
if
(
state
is
CourseDetailSuccess
){
chapters
=
state
.
courseDetailModel
.
data
!.
chapters
!;
if
(
chapters
.
isEmpty
){
return
const
Text
(
'Chua Co Noi Dung Khoa Hoc'
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
),);
}
}
if
(
chapters
.
isNotEmpty
){
if
(
state
is
CourseDetailLoading
){
return
return
const
CircularProgressIndicator
();
SingleChildScrollView
(
}
child:
Column
(
if
(
state
is
CourseDetailSuccess
){
chapters
=
state
.
courseDetailModel
.
data
!.
chapters
!;
if
(
chapters
.
isEmpty
){
return
const
Text
(
'Chua Co Noi Dung Khoa Hoc'
,
style:
TextStyle
(
fontSize:
15
,
color:
AppColors
.
red_light
),);
}
if
(
chapters
.
isNotEmpty
){
return
Column
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
Padding
(
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
0
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
0
,
0
),
child:
Row
(
child:
Column
(
children:
[
children:
[
const
Text
(
'Thong Tin chi tiet'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),),
// Text(chapters[0].name.toString(),style: const TextStyle(fontSize: 15,fontWeight: FontWeight.bold),
const
SizedBox
(
width:
100
),
// softWrap: false,
TextButton
(
// maxLines: 1,
child:
Text
(
'Nhan xet ve khoa hoc'
),
// overflow: TextOverflow.ellipsis),
onPressed:
()
{
Row
(
print
(
'Pressed'
);
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
}
children:
[
)
const
Text
(
'Thong Tin chi tiet'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),),
TextButton
(
child:
Text
(
'Nhan xet ve khoa hoc'
),
onPressed:
()
{
print
(
'Pressed'
);
}
)
],
),
],
],
),
),
),
),
Text
(
chapters
[
0
].
name
!),
Text
(
chapters
.
length
.
toString
()),
Text
(
chapters
[
0
].
listLesson
![
0
].
name
!),
Expanded
(
Text
(
chapters
[
0
].
listLesson
![
0
].
createUser
!),
child:
Padding
(
Text
(
chapters
[
0
].
listLesson
![
0
].
listPart
![
0
].
partType
!),
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
0
,
0
),
LessionWidget
(
chapters
[
0
].
listLesson
![
0
].
lessonId
!=
null
?
chapters
[
0
].
listLesson
![
0
].
lessonId
!:
'fb228efa-7b32-419e-98b4-a6d5135f4361'
),
child:
],),
ListView
.
builder
(
);
itemCount:
chapters
.
length
,
physics:
const
AlwaysScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
return
ExpansionTile
(
title:
Text
(
chapters
[
index
].
name
!),
);
},
),
),
),
// ExpansionTile(
// title: null,
//
// ),
// 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!!!!!'
);
}
}
return
const
Text
(
'Default CourseDetail!!!!!'
);
);
}
}
);
),
}
),
),
],)
],)
);
);
...
...
lib/app/module/new/widgets/new_widget.dart
View file @
b7f4483b
...
@@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
...
@@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import
'package:ongbut_ntmanh/app/module/new/model/new_model.dart'
;
import
'package:ongbut_ntmanh/app/module/new/model/new_model.dart'
;
import
'../../../../const/colors.dart'
;
import
'../../../../const/colors.dart'
;
import
'../../../../res/images/images.dart'
;
import
'../../../../widgets/widgets_util.dart'
;
import
'../../../../widgets/widgets_util.dart'
;
import
'../bloc/new_bloc.dart'
;
import
'../bloc/new_bloc.dart'
;
...
@@ -72,7 +73,7 @@ class NewWidget extends StatelessWidget {
...
@@ -72,7 +73,7 @@ class NewWidget extends StatelessWidget {
// ),
// ),
// ],
// ],
),
),
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.5
:
getHeight
(
context
)*
0.3
5
,
width:
double
.
maxFinite
,
width:
double
.
maxFinite
,
child:
child:
ListView
.
builder
(
ListView
.
builder
(
...
@@ -105,24 +106,21 @@ class NewWidget extends StatelessWidget {
...
@@ -105,24 +106,21 @@ class NewWidget extends StatelessWidget {
ClipRRect
(
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8.0
),
borderRadius:
BorderRadius
.
circular
(
8.0
),
child:
child:
Image
.
network
(
state
.
newModel
.
data
![
index
].
urlImageRepresent
!=
null
?
state
.
newModel
.
data
![
index
].
urlImageRepresent
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
,
Image
.
network
(
state
.
newModel
.
data
![
index
].
urlImageRepresent
!,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.3
:
getHeight
(
context
)*
0.2
,
width:
double
.
maxFinite
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.3
:
getHeight
(
context
)*
0.2
,
width:
double
.
maxFinite
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
return
const
Text
(
'😢'
);
return
Image
.
asset
(
Images
.
load_err
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.3
:
getHeight
(
context
)*
0.2
,
width:
double
.
maxFinite
,
);
},
},
),
),
),
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
all
(
0.0
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
20
,
0
,
0
),
child:
child:
Text
(
state
.
newModel
.
data
![
index
].
title
!),
Text
(
state
.
newModel
.
data
![
index
].
title
!),
//Text('abc'),
),
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
all
(
0.0
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
0
),
child:
child:
Text
(
state
.
newModel
.
data
![
index
].
title
!),
Text
(
state
.
newModel
.
data
![
index
].
title
!),
//Text('123'),
),
),
],
],
),
),
...
...
lib/app/module/school/widgets/school_widget.dart
View file @
b7f4483b
...
@@ -6,6 +6,7 @@ import 'package:ongbut_ntmanh/app/module/coursedetail/model/course_detail_model.
...
@@ -6,6 +6,7 @@ import 'package:ongbut_ntmanh/app/module/coursedetail/model/course_detail_model.
import
'package:ongbut_ntmanh/app/module/school/model/list_data.dart'
;
import
'package:ongbut_ntmanh/app/module/school/model/list_data.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'package:ongbut_ntmanh/const/colors.dart'
;
import
'../../../../res/images/images.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../../ui/search_page.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../../coursedetail/widgets/course_detail.dart'
;
import
'../bloc/school_bloc.dart'
;
import
'../bloc/school_bloc.dart'
;
...
@@ -93,12 +94,13 @@ class SchoolWidget extends StatelessWidget {
...
@@ -93,12 +94,13 @@ class SchoolWidget extends StatelessWidget {
ClipRRect
(
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8.0
),
borderRadius:
BorderRadius
.
circular
(
8.0
),
child:
child:
Image
.
network
(
listData
[
index
].
image
!
=
null
?
listData
[
index
].
image
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
,
Image
.
network
(
listData
[
index
].
image
!,
fit:
BoxFit
.
fill
,
height:
200
,
width:
double
.
maxFinite
,
fit:
BoxFit
.
fill
,
height:
200
,
width:
double
.
maxFinite
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
StackTrace
?
stackTrace
)
{
return
const
Text
(
'😢'
);
return
Image
.
asset
(
Images
.
load_err
);
},),
},
),
),
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
...
...
lib/app/ui/search_page.dart
View file @
b7f4483b
...
@@ -3,8 +3,8 @@ import 'package:flutter/cupertino.dart';
...
@@ -3,8 +3,8 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'package:ongbut_ntmanh/app/module/course/model/list_data.dart'
;
import
'package:ongbut_ntmanh/widgets/widgets_util.dart'
;
import
'../../const/colors.dart'
;
import
'../../const/colors.dart'
;
import
'../../res/images/images.dart'
;
import
'../module/course/bloc/course_bloc.dart'
;
import
'../module/course/bloc/course_bloc.dart'
;
import
'../module/course/model/course_model.dart'
;
import
'../module/course/model/course_model.dart'
;
import
'../module/coursedetail/widgets/course_detail.dart'
;
import
'../module/coursedetail/widgets/course_detail.dart'
;
...
@@ -36,32 +36,38 @@ class SearchWidget extends StatelessWidget {
...
@@ -36,32 +36,38 @@ class SearchWidget extends StatelessWidget {
if
(
state
is
CourseSuccess
){
if
(
state
is
CourseSuccess
){
listData
=
state
.
courseModel
.
data
!.
listData
!;
listData
=
state
.
courseModel
.
data
!.
listData
!;
return
return
CustomScrollView
(
Container
(
scrollDirection:
Axis
.
vertical
,
// listview vuot ngang
height:
double
.
maxFinite
,
slivers:
<
Widget
>[
width:
double
.
maxFinite
,
SliverGrid
(
color:
AppColors
.
background
,
gridDelegate:
const
SliverGridDelegateWithMaxCrossAxisExtent
(
alignment:
Alignment
.
topCenter
,
maxCrossAxisExtent:
300
,
child:
CustomScrollView
(
mainAxisSpacing:
1
,
scrollDirection:
Axis
.
vertical
,
// listview vuot ngang
crossAxisSpacing:
0
,
slivers:
<
Widget
>[
childAspectRatio:
1
,
SliverGrid
(
gridDelegate:
const
SliverGridDelegateWithMaxCrossAxisExtent
(
maxCrossAxisExtent:
350
,
mainAxisSpacing:
0
,
crossAxisSpacing:
0
,
childAspectRatio:
0.65
,
),
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
{
if
(
index
<
listData
.
length
)
{
return
_courseList
(
listData
[
index
],
context
);
}
else
{
Timer
(
const
Duration
(
milliseconds:
20
),
()
{
scrollController
.
jumpTo
(
scrollController
.
position
.
maxScrollExtent
);
});
return
const
CircularProgressIndicator
();
}
},
childCount:
listData
.
length
,
),
),
),
delegate:
SliverChildBuilderDelegate
(
],
(
BuildContext
context
,
int
index
)
{
),
if
(
index
<
listData
.
length
)
{
return
_courseList
(
listData
[
index
],
context
);
}
else
{
Timer
(
const
Duration
(
milliseconds:
20
),
()
{
scrollController
.
jumpTo
(
scrollController
.
position
.
maxScrollExtent
);
});
return
const
CircularProgressIndicator
();
}
},
childCount:
listData
.
length
,
),
),
],
);
);
}
}
return
const
Text
(
'CourseFailed'
);
return
const
Text
(
'CourseFailed'
);
...
@@ -85,7 +91,7 @@ Widget _courseList( listData, BuildContext context) {
...
@@ -85,7 +91,7 @@ Widget _courseList( listData, BuildContext context) {
// });
// });
},
},
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
15
,
1
0
,
15
,
10
),
padding:
const
EdgeInsets
.
fromLTRB
(
15
,
1
5
,
15
,
15
),
child:
child:
Container
(
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
),
...
@@ -97,12 +103,53 @@ Widget _courseList( listData, BuildContext context) {
...
@@ -97,12 +103,53 @@ Widget _courseList( listData, BuildContext context) {
child:
child:
Image
.
network
(
listData
.
image
!=
null
?
listData
.
image
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
,
Image
.
network
(
listData
.
image
!=
null
?
listData
.
image
!:
'https://oss.myitsol.com/imes-public/2022/12/11/neymar_145527553.PNG'
,
fit:
BoxFit
.
fill
,
fit:
BoxFit
.
fill
,
height:
checkLandscape
(
context
)?
getHeight
(
context
)*
0.25
:
getHeight
(
context
)*
0.15
,
errorBuilder:
(
BuildContext
context
,
Object
exception
,
StackTrace
?
stackTrace
)
{
return
Image
.
asset
(
Images
.
load_err
);
},
height:
130
,
// height: checkLandscape(context)?getHeight(context)*0.25:getHeight(context)*0.15,
width:
double
.
maxFinite
,
width:
double
.
maxFinite
,
),
),
),
),
Text
(
listData
.
keyword
!=
null
?
listData
.
keyword
:
'Null'
),
Padding
(
Text
(
listData
.
name
!=
null
?
listData
.
name
:
'Null'
),
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Container
(
alignment:
Alignment
.
centerLeft
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
max
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
10
,
0
,
0
),
child:
Text
(
listData
.
name
??
'Null'
,
softWrap:
false
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
),
),
Text
(
listData
.
keyword
??
'Null'
,
softWrap:
false
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
40
,
0
,
0
),
child:
OutlinedButton
(
onPressed:
()
{
},
style:
OutlinedButton
.
styleFrom
(
minimumSize:
const
Size
.
fromHeight
(
35
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
backgroundColor:
Colors
.
white
,
// background
primary:
AppColors
.
primary
,
// foreground text
side:
const
BorderSide
(
color:
AppColors
.
primary
),
// foreground border
),
child:
const
Text
(
'Dang Ky'
,
style:
TextStyle
(
fontSize:
15
)),
),
),
],
),
),
),
],
],
),
),
),
),
...
...
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