Commit 68255175 authored by NguyenTienManh's avatar NguyenTienManh

update 14-2

parent 166d773f
......@@ -112,11 +112,11 @@ class CommentWidget extends StatelessWidget {
)
],),
),
Text(state.commentModel.data![index].courseKeyword!=null?state.commentModel.data![index].courseKeyword!:'Null',style: const TextStyle(fontWeight: FontWeight.bold),),
Text(state.commentModel.data![index].courseKeyword!=null?state.commentModel.data![index].courseKeyword!:'',style: const TextStyle(fontWeight: FontWeight.bold),),
Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:
Text(state.commentModel.data![index].content!=null?state.commentModel.data![index].content!:'Null',style: const TextStyle(fontSize: 15),
Text(state.commentModel.data![index].content!=null?state.commentModel.data![index].content!:'',style: const TextStyle(fontSize: 15),
softWrap: false,
maxLines: 4,
overflow: TextOverflow.ellipsis),
......
......@@ -9,7 +9,6 @@ import '../../../../res/images/images.dart';
import '../../lession/widgets/lession_widget.dart';
import '../bloc/course_detail_bloc.dart';
// dang loi
class CourseDetailWidget extends StatelessWidget {
String courseId;
String image;
......@@ -33,12 +32,6 @@ class CourseDetailWidget extends StatelessWidget {
return Image.asset(Images.load_err,fit: BoxFit.fill,height: checkLandscape(context)?getHeight(context)*0.5:getHeight(context)*0.3,width: double.maxFinite,);
},
),
Row(
children: [
const Text('ID Course = ',style: TextStyle(fontSize: 15,color: AppColors.red_light)),
Text(courseId),
],
),
Expanded(
child: BlocConsumer<CourseDetailBloc, CourseDetailState>(
listener: (context, state) async {},
......@@ -74,20 +67,22 @@ class CourseDetailWidget extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('Thong Tin chi tiet',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 15),),
// Image.asset(Images.see,height: 20,width: 20,),
TextButton(onPressed: (){},
child: const Text('Thong Tin chi tiet',
style: TextStyle(fontSize: 15),)),
// const Text('Thong Tin chi tiet',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 15),),
TextButton(
child: Text('Nhan xet ve khoa hoc'),
child: Text('Nhan xet ve khoa hoc',style: TextStyle(color: AppColors.black),),
onPressed: () {
print('Pressed');
}
)
],
),
],
),
),
Text(chapters.length.toString()),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
......@@ -97,10 +92,11 @@ class CourseDetailWidget extends StatelessWidget {
physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return
// chapters[index].listLesson!.isNotEmpty?
ExpansionTile(
title: Text(chapters[index].name!),
children: [
LessionWidget( chapters[index].listLesson![0].lessonId!),
chapters[index].listLesson!.isNotEmpty?LessionWidget( chapters[index].listLesson![0].lessonId!):const Text(''),
],
);
},
......
......@@ -5,22 +5,19 @@ import '../../playvideo/page/play_video.dart';
import '../bloc/lesson_bloc.dart';
import '../model/lesson_model.dart';
class LessionWidget extends StatefulWidget {
class LessionWidget extends StatelessWidget {
String lessonID;
LessionWidget( this.lessonID, {Key? key}) : super(key: key);
@override
State<LessionWidget> createState() => _LessionWidgetState();
}
class _LessionWidgetState extends State<LessionWidget> {
LessonModel? lessonModel;
String pl = 'Playlist video';
@override
Widget build(BuildContext context) {
BlocProvider.of<LessonBloc>(context).add(
RequestLesson(context: context, lessonID: widget.lessonID));
RequestLesson(context: context, lessonID: lessonID));
return
BlocConsumer<LessonBloc, LessonState>(
listener: (context, state) async {},
......@@ -39,7 +36,7 @@ class _LessionWidgetState extends State<LessionWidget> {
}
if(state is LessonSuccess){
return
ListView.builder(
state.lessonModel.data!.isNotEmpty?ListView.builder(
shrinkWrap: true,
itemCount: state.lessonModel.data!.length,
itemBuilder: (context, index){
......@@ -48,9 +45,9 @@ class _LessionWidgetState extends State<LessionWidget> {
onTap: (){
state.lessonModel.data![index].partType == 'YOUTUBE'?
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PlayVideoPage(link: state.lessonModel.data![index].playlist![0].link!)),
):const Text('---------');
context,
MaterialPageRoute(builder: (context) => PlayVideoPage(link: state.lessonModel.data![index].playlist![0].link!)),
):const Text('---------');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
......@@ -61,7 +58,7 @@ class _LessionWidgetState extends State<LessionWidget> {
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child:
Text(state.lessonModel.data![index].title!=null?state.lessonModel.data![index].title!:'Null'),
Text(state.lessonModel.data![index].title!=null?state.lessonModel.data![index].title!:''),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 3, 20, 3),
......@@ -76,7 +73,8 @@ class _LessionWidgetState extends State<LessionWidget> {
],),
);
}
);
):const Text('');
}
return const Text('NewFailed');
}
......@@ -85,3 +83,5 @@ class _LessionWidgetState extends State<LessionWidget> {
);
}
}
......@@ -30,8 +30,8 @@ class LoginPage extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Dang Ky & Tu Van',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16),),
children: const [
Text('Dang Ky & Tu Van',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16),),
],
),
),
......@@ -89,11 +89,11 @@ class LoginPage extends StatelessWidget {
}
if (state is LoginInitial) {
return
Text('LoginInitial');
const Text('LoginInitial');
}
if (state is LoginSuccess) {
return
Text('Dang Nhap Thanh Cong');
const Text('Dang Nhap Thanh Cong');
}
return const CircularProgressIndicator();
}),
......
......@@ -10,20 +10,6 @@ import '../../module/new/widgets/new_widget.dart';
import '../../module/school/widgets/school_widget.dart';
import '../search_page.dart';
// khoa hoc thu mien phi
// rourse
// https://imes-api.myitsol.com/api/v1/public/search-courses
// https://imes-api.myitsol.com/api/v1/public/course?grade=b9467868-d1d8-4099-9120-d995c41b3402
// 1
// https://imes-api.myitsol.com/api/v1/public/search-courses?gradeId=676f1137-3f22-4260-ac50-f4862d169ecf
// https://imes-api.myitsol.com/api/v1/public/courses/lesson-free?startRecord=0&size=10
// News https://imes-api.myitsol.com/api/v1/public/blog
// Comment https://imes-api.myitsol.com/api/v1/public/comment/course?courseId=
// https://imes-api.myitsol.com/api/v1/public/course/5410fd59-ccaa-43ec-8e7f-1c8561a8eee6
// https://imes-api.myitsol.com/api/v1/student/course/part?lessonId=fb228efa-7b32-419e-98b4-a6d5135f4361
class HomePage extends StatefulWidget {
HomePage({Key? key}) : super(key: key);
......@@ -96,12 +82,11 @@ class _HomePageState extends State<HomePage> {
),
],),
child: Row(children: [
Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Image.asset(Images.logoWhite,height: checkLandscape(context)?getHeight(context)*0.25:getHeight(context)*0.07,width: 90,),
child: Image.asset(Images.logoWhite,height: checkLandscape(context)?getHeight(context)*0.25:getHeight(context)*0.07,
width:checkLandscape(context)?getWidth(context)*0.2:getWidth(context)*0.25),
),
InkWell(
onTap: (){
Navigator.push(
......@@ -127,7 +112,7 @@ class _HomePageState extends State<HomePage> {
],
),
height: 40,
width: checkLandscape(context)?getWidth(context)*0.7:getWidth(context)*0.6,
width: checkLandscape(context)?getWidth(context)*0.7:getWidth(context)*0.55,
child: const Padding(
padding: EdgeInsets.fromLTRB(5, 10, 0, 10),
child: Text('Tim Kiem',style: TextStyle(fontSize: 15,color: Colors.white),),
......@@ -144,7 +129,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: Container(
margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
margin: const EdgeInsets.fromLTRB(10, 0, 10, 0),
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: const BorderRadius.all(Radius.circular(10)),
......@@ -290,78 +275,11 @@ class _HomePageState extends State<HomePage> {
const Text('Hoi But',style: TextStyle(fontSize: 12,fontWeight: FontWeight.bold),),
],
),
],
)
),
);
}
// Widget _register(){
// return
// Padding(
// padding: const EdgeInsets.fromLTRB(8, 10, 8, 0),
// child: SizedBox(
// height: checkLandscape(context)?getHeight(context)*0.5:getHeight(context)*0.5,
// child:
// Column(
// children: [
// Padding(
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
// child:
// Center(
// child: Text('Dang Ky & Tu Van'),
// ),
// ),
// TextField(
// //obscureText: true,
// decoration: InputDecoration(
// focusColor: AppColors.error,
// hoverColor: AppColors.error,
// border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(15.0))),
// labelText: 'Ho ten phu huynh *',
// ),
// ),
// TextField(
// //obscureText: true,
// decoration: InputDecoration(
// focusColor: AppColors.error,
// hoverColor: AppColors.error,
// border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(15.0))),
// labelText: 'Ho ten phu huynh *',
// ),
// ),
// DropdownButton<String>(
// disabledHint: const Text('Nam Sinh111111111',
// style: TextStyle(fontSize: 16,color: AppColors.black)),
// items: items.map<DropdownMenuItem<String>>((String value) {
// return DropdownMenuItem<String>(
// alignment: Alignment.center,
// value: value,
// child:
// Text(
// value.substring(0),
// style: const TextStyle(fontSize: 20,color: AppColors.black),
// ),
// );
// }).toList(),
// onChanged: (String? newValue) {},
// ),
// TextField(
// //obscureText: true,
// decoration: InputDecoration(
// focusColor: AppColors.error,
// hoverColor: AppColors.error,
// border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(15.0))),
// labelText: 'Ho ten phu huynh *',
// ),
// ),
//
// ],
// ),
// ),
// );
// }
}
......
......@@ -122,11 +122,11 @@ Widget _courseList( listData, BuildContext context) {
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Text(listData.name ?? 'Null',softWrap: false,
child: Text(listData.name ?? '',softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis),
),
Text(listData.keyword ?? 'Null',softWrap: false,
Text(listData.keyword ?? '',softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis),
Padding(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment