取消收藏
This commit is contained in:
parent
dd8ae7724a
commit
8e0522bc6b
|
|
@ -46,7 +46,7 @@ class Items extends Object {
|
||||||
int teacherId;
|
int teacherId;
|
||||||
|
|
||||||
@JsonKey(name: 'teacherAccount')
|
@JsonKey(name: 'teacherAccount')
|
||||||
String teacherAccount;
|
String? teacherAccount;
|
||||||
|
|
||||||
@JsonKey(name: 'folderName')
|
@JsonKey(name: 'folderName')
|
||||||
String folderName;
|
String folderName;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,49 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:marking_app/common/model/job/job_fav_student.dart';
|
||||||
|
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||||
|
import 'package:photo_view/photo_view.dart';
|
||||||
import 'package:photo_view/photo_view_gallery.dart';
|
import 'package:photo_view/photo_view_gallery.dart';
|
||||||
|
|
||||||
class FavoriteStudentDialog extends StatefulWidget {
|
class FavoriteStudentDialog extends StatefulWidget {
|
||||||
const FavoriteStudentDialog({Key? key}) : super(key: key);
|
final Items item;
|
||||||
|
final List group;
|
||||||
|
final Function deleteFav;
|
||||||
|
|
||||||
|
const FavoriteStudentDialog(
|
||||||
|
{Key? key, required this.item, required this.group,required this.deleteFav})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FavoriteStudentDialog> createState() => _FavoriteStudentDialogState();
|
State<FavoriteStudentDialog> createState() => _FavoriteStudentDialogState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
||||||
int defaultIndex = 1;
|
int defaultIndex = 0;
|
||||||
|
List<Items> imageList = [];
|
||||||
|
late PageController pageController;
|
||||||
|
late Items currentStudent;
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
pageController = PageController(initialPage: defaultIndex);
|
||||||
|
currentStudent = widget.item;
|
||||||
|
List<Items> list = [];
|
||||||
|
widget.group.forEach((element) {
|
||||||
|
for (var item in element['list']) {
|
||||||
|
list.add(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setState(() {
|
||||||
|
imageList = list;
|
||||||
|
defaultIndex = list.indexWhere((element) => element.id == widget.item.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
pageController.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -25,24 +57,34 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'14班 张小凡',
|
'${currentStudent.className} ${currentStudent.studentName}',
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4E73FD)),
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4E73FD)),
|
||||||
),
|
),
|
||||||
Expanded(child: Container()),
|
Expanded(child: Container()),
|
||||||
Text(
|
Text(
|
||||||
'6题',
|
'第${currentStudent.questionPage}页',
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF868686)),
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF868686)),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.r),
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/favorite_delete_icon.png',
|
|
||||||
width: 22.r,
|
|
||||||
height: 22.r,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: (){
|
onTap: (){
|
||||||
|
widget.deleteFav(currentStudent);
|
||||||
|
imageList.removeAt(defaultIndex);
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8.r),
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
width: 22.r,
|
||||||
|
height: 22.r,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
|
@ -53,47 +95,106 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.r,),
|
SizedBox(
|
||||||
|
height: 10.r,
|
||||||
|
),
|
||||||
|
imageList.length>0?
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
color:Color(0xFF868686),
|
color: Colors.white,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
/* child: PhotoViewGallery.builder(
|
child: PhotoViewGallery.builder(
|
||||||
scrollPhysics: const BouncingScrollPhysics(),
|
scrollPhysics: const BouncingScrollPhysics(),
|
||||||
builder: (BuildContext context, int index) {
|
builder: (BuildContext context, int index) {
|
||||||
|
final Items item = imageList[index];
|
||||||
return PhotoViewGalleryPageOptions(
|
return PhotoViewGalleryPageOptions(
|
||||||
imageProvider: NetworkImage(widget.imageItems[index]),
|
imageProvider: NetworkImage(item.questionPicture),
|
||||||
|
heroAttributes: PhotoViewHeroAttributes(tag: item.id),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: 2,
|
itemCount: imageList.length,
|
||||||
pageController:PageController(initialPage: defaultIndex),
|
pageController: pageController,
|
||||||
// onPageChanged: (){},
|
onPageChanged: (index) {
|
||||||
|
setState(() {
|
||||||
|
defaultIndex = index;
|
||||||
|
currentStudent = imageList[index];
|
||||||
|
});
|
||||||
|
},
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
),*/
|
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
):Padding(
|
||||||
|
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
|
||||||
|
child: MyEmptyWidget(),
|
||||||
),
|
),
|
||||||
|
if(imageList.length>0)
|
||||||
Padding(
|
Padding(
|
||||||
padding:EdgeInsets.symmetric(vertical: 15.r),
|
padding: EdgeInsets.symmetric(vertical: 15.r),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
InkWell(
|
||||||
width: (MediaQuery.of(context).size.width - 78.r)/2 - 10.r,
|
onTap: () {
|
||||||
height: 28.r,
|
if (defaultIndex > 0) {
|
||||||
decoration: BoxDecoration(
|
setState(() {
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
defaultIndex = defaultIndex - 1;
|
||||||
border: Border.all(width: 1.r,color: Color(0xFFCACACA),style: BorderStyle.solid),
|
pageController.jumpToPage(defaultIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width:
|
||||||
|
(MediaQuery.of(context).size.width - 78.r) / 2 - 10.r,
|
||||||
|
height: 28.r,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.r,
|
||||||
|
color: Color(0xFFCACACA),
|
||||||
|
style: BorderStyle.solid),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'上一页',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.r,
|
||||||
|
color: defaultIndex == 0
|
||||||
|
? Color(0xFFCACACA)
|
||||||
|
: Color(0xFF505E6E)),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
child: Center(child: Text('上一页',style: TextStyle(fontSize: 10.r,color: Color(0xFF505E6E)),)),
|
|
||||||
),
|
),
|
||||||
Container(
|
InkWell(
|
||||||
width: (MediaQuery.of(context).size.width - 78.r)/2 - 10.r,
|
onTap: () {
|
||||||
height: 28.r,
|
if (defaultIndex < imageList.length - 1) {
|
||||||
decoration: BoxDecoration(
|
setState(() {
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
defaultIndex = defaultIndex + 1;
|
||||||
border: Border.all(width: 1.r,color: Color(0xFFCACACA),style: BorderStyle.solid),
|
pageController.jumpToPage(defaultIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width:
|
||||||
|
(MediaQuery.of(context).size.width - 78.r) / 2 - 10.r,
|
||||||
|
height: 28.r,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.r,
|
||||||
|
color: Color(0xFFCACACA),
|
||||||
|
style: BorderStyle.solid),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'下一页',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.r,
|
||||||
|
color: defaultIndex == imageList.length - 1
|
||||||
|
? Color(0xFFCACACA)
|
||||||
|
: Color(0xFF505E6E)),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
child: Center(child: Text('下一页',style: TextStyle(fontSize: 10.r,color: Color(0xFF505E6E)),)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:marking_app/common/model/job/job_fav_student.dart';
|
||||||
import 'package:marking_app/common/model/job/job_favorite_item_model.dart';
|
import 'package:marking_app/common/model/job/job_favorite_item_model.dart';
|
||||||
import 'package:marking_app/common/model/job/job_report_join_class.dart';
|
import 'package:marking_app/common/model/job/job_report_join_class.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/pages/favorite_student_dialog.dart';
|
import 'package:marking_app/pages/homework_correction/pages/favorite_student_dialog.dart';
|
||||||
|
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||||
import 'package:marking_app/utils/index.dart';
|
import 'package:marking_app/utils/index.dart';
|
||||||
import 'package:marking_app/utils/my_text.dart';
|
import 'package:marking_app/utils/my_text.dart';
|
||||||
import 'package:marking_app/utils/request/rest_client.dart';
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
|
|
@ -61,7 +62,7 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
Future<List<Items>> getData() async {
|
Future<List<Items>> getData() async {
|
||||||
var _client = await getClient();
|
var _client = await getClient();
|
||||||
var result =
|
var result =
|
||||||
await _client.getListOfJobFavorites(widget.jobId, widget.jobName, widget.className, loginName, pageSize);
|
await _client.getListOfJobFavorites(widget.jobId, widget.jobName, widget.className, pageSize);
|
||||||
return result.data!.items;
|
return result.data!.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,20 +90,30 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
});
|
});
|
||||||
}, mounted);
|
}, mounted);
|
||||||
}
|
}
|
||||||
print('involveClasses=${involveClasses!.length}');
|
|
||||||
_future = getData();
|
_future = getData();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showStudentDialog(BuildContext context) {
|
deleteFav(Items student) async{
|
||||||
|
RestClient _client = await getClient();
|
||||||
|
BaseStructureResult res = await _client.getJobDeFavorites(widget.jobId,student.studentId,student.questionPage);
|
||||||
|
if(res.success){
|
||||||
|
_future = getData();
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showStudentDialog(BuildContext context,Items item,List groups) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
insetPadding: EdgeInsets.all(25.r),
|
insetPadding: EdgeInsets.all(25.r),
|
||||||
content: FavoriteStudentDialog(),
|
content: FavoriteStudentDialog(item: item,group: groups, deleteFav: deleteFav,),
|
||||||
contentPadding: EdgeInsets.all(0),
|
contentPadding: EdgeInsets.all(0),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))));
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))));
|
||||||
},
|
},
|
||||||
|
|
@ -127,17 +138,17 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
context,
|
context,
|
||||||
_future,
|
_future,
|
||||||
(List<Items>? datas) {
|
(List<Items>? datas) {
|
||||||
/* if (datas == null)
|
if (datas == null)
|
||||||
return Container(
|
return Container(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: quickText('请求错误'),
|
child: quickText('请求错误'),
|
||||||
),
|
),
|
||||||
);*/
|
);
|
||||||
print('datas${datas}');
|
|
||||||
|
|
||||||
List pageList = [];
|
List pageList = [];
|
||||||
List groupList = [];
|
List groupList = [];
|
||||||
|
String name = '';
|
||||||
if (datas!.length > 0) {
|
if (datas!.length > 0) {
|
||||||
|
name = datas[0].jobName;
|
||||||
for (var item in datas) {
|
for (var item in datas) {
|
||||||
pageList.add(item.questionPage);
|
pageList.add(item.questionPage);
|
||||||
}
|
}
|
||||||
|
|
@ -147,8 +158,8 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
var printList = datas.where((element) => element.questionPage == page).toList();
|
var printList = datas.where((element) => element.questionPage == page).toList();
|
||||||
groupList.add({"questionPage": page, "list": printList});
|
groupList.add({"questionPage": page, "list": printList});
|
||||||
}
|
}
|
||||||
|
groupList.sort((a, b) => a['questionPage'].compareTo(b['questionPage']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -158,7 +169,7 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'函数A的对称性研究',
|
name,
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C)),
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C)),
|
||||||
),
|
),
|
||||||
// 下拉框
|
// 下拉框
|
||||||
|
|
@ -186,74 +197,84 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
color: Color(0xFFCCCCCC),
|
color: Color(0xFFCCCCCC),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
groupList.length>0?
|
||||||
Expanded(
|
Expanded(
|
||||||
child: isPadFlag
|
child: isPadFlag
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: List.generate(groupList.length, (index) {
|
||||||
Padding(
|
var item = groupList[index];
|
||||||
padding: EdgeInsets.only(bottom: 5.r),
|
return Column(
|
||||||
child: Text(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
'第六题',
|
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF2E5BFF)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GridView(
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 2,
|
|
||||||
mainAxisSpacing: 8.r,
|
|
||||||
crossAxisSpacing: 10.r,
|
|
||||||
childAspectRatio: 556 / 112,
|
|
||||||
),
|
|
||||||
shrinkWrap: true,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
padding: EdgeInsets.only(bottom: 5.r),
|
||||||
decoration: BoxDecoration(
|
child: Text(
|
||||||
color: Colors.white,
|
'第${item['questionPage']}页',
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF2E5BFF)),
|
||||||
),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
showStudentDialog(context);
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
quickText('张小凡', color: Color(0xFF333333), size: 12.sp),
|
|
||||||
Expanded(child: Container()),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(right: 8.r),
|
|
||||||
child: Text(
|
|
||||||
'12班',
|
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF666666)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
print('删除');
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/favorite_delete_icon.png',
|
|
||||||
width: 26.r,
|
|
||||||
height: 26.r,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GridView(
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
mainAxisSpacing: 8.r,
|
||||||
|
crossAxisSpacing: 10.r,
|
||||||
|
childAspectRatio: 556 / 112,
|
||||||
|
),
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: List.generate(item['list'].length, (i){
|
||||||
|
Items student = item['list'][i];
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showStudentDialog(context,student,groupList);
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
quickText(student.studentName, color: Color(0xFF333333), size: 12.sp),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(right: 8.r),
|
||||||
|
child: Text(
|
||||||
|
student.className,
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF666666)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
deleteFav(student);
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
width: 26.r,
|
||||||
|
height: 26.r,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
],
|
})
|
||||||
|
|
||||||
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
// Items item = datas[index];
|
var item = groupList[index];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -262,47 +283,61 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(bottom: 5.r),
|
padding: EdgeInsets.only(bottom: 5.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
'第六题',
|
'第${item['questionPage']}页',
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF2E5BFF)),
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF2E5BFF)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
ListView.builder(
|
||||||
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
itemBuilder: (context,i){
|
||||||
margin: EdgeInsets.only(top: 5.r),
|
Items student = item['list'][i];
|
||||||
decoration: BoxDecoration(
|
return InkWell(
|
||||||
color: Colors.white,
|
onTap: (){
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
showStudentDialog(context,student,groupList);
|
||||||
),
|
},
|
||||||
child: Row(
|
child: Container(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
||||||
children: [
|
margin: EdgeInsets.only(top: 5.r),
|
||||||
quickText('张小凡', color: Color(0xFF333333), size: 14.sp),
|
decoration: BoxDecoration(
|
||||||
Expanded(child: Container()),
|
color: Colors.white,
|
||||||
Padding(
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
padding: EdgeInsets.only(right: 8.r),
|
|
||||||
child: Text(
|
|
||||||
'12班',
|
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
InkWell(
|
child: Row(
|
||||||
onTap: () async {},
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
child: Image.asset(
|
children: [
|
||||||
'assets/images/favorite_delete_icon.png',
|
quickText(student.studentName, color: Color(0xFF333333), size: 14.sp),
|
||||||
width: 32.r,
|
Expanded(child: Container()),
|
||||||
height: 32.r,
|
Padding(
|
||||||
),
|
padding: EdgeInsets.only(right: 8.r),
|
||||||
|
child: Text(
|
||||||
|
student.className,
|
||||||
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
deleteFav(student);
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
width: 32.r,
|
||||||
|
height: 32.r,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
),
|
},itemCount: item['list'].length,shrinkWrap: true,),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
// itemCount: datas.length,
|
itemCount: groupList.length,
|
||||||
itemCount: 10,
|
|
||||||
),
|
),
|
||||||
|
):Padding(
|
||||||
|
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
|
||||||
|
child: MyEmptyWidget(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,6 @@ abstract class RestClient {
|
||||||
@the_retrofit.Query("JobId") int jobId,
|
@the_retrofit.Query("JobId") int jobId,
|
||||||
@the_retrofit.Query("JobName") String jobName,
|
@the_retrofit.Query("JobName") String jobName,
|
||||||
@the_retrofit.Query("className") String className,
|
@the_retrofit.Query("className") String className,
|
||||||
@the_retrofit.Query("Account") String loginName,
|
|
||||||
@the_retrofit.Query("PageSize") int pageSize,
|
@the_retrofit.Query("PageSize") int pageSize,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -340,4 +339,10 @@ abstract class RestClient {
|
||||||
// 作业 => 取消/设置优先
|
// 作业 => 取消/设置优先
|
||||||
@the_retrofit.POST("/api/read/jc-job-read-level")
|
@the_retrofit.POST("/api/read/jc-job-read-level")
|
||||||
Future<BaseStructureResult> getSetJobReadLevel(@the_retrofit.Body() JobLevelSetParams params);
|
Future<BaseStructureResult> getSetJobReadLevel(@the_retrofit.Body() JobLevelSetParams params);
|
||||||
|
|
||||||
|
|
||||||
|
// 作业 => 取消收藏
|
||||||
|
@the_retrofit.POST("/api/jobs/de-fav-student-job")
|
||||||
|
Future<BaseStructureResult> getJobDeFavorites(
|
||||||
|
@the_retrofit.Field("jobId") int jobId, @the_retrofit.Field("studentId") int studentId,@the_retrofit.Field("questionPage") int questionPage);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue