删除收藏二次确认弹框
This commit is contained in:
parent
6d7857ccef
commit
2ad03b6b20
|
|
@ -10,12 +10,14 @@ class FavoriteStudentDialog extends StatefulWidget {
|
||||||
final Items item;
|
final Items item;
|
||||||
final List group;
|
final List group;
|
||||||
final Function deleteFav;
|
final Function deleteFav;
|
||||||
|
final Future<bool> Function() confirmDialog;
|
||||||
|
|
||||||
const FavoriteStudentDialog(
|
const FavoriteStudentDialog(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.item,
|
required this.item,
|
||||||
required this.group,
|
required this.group,
|
||||||
required this.deleteFav})
|
required this.deleteFav,
|
||||||
|
required this.confirmDialog})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -69,12 +71,11 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF868686)),
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF868686)),
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
bool confim = await widget.confirmDialog();
|
||||||
|
if (confim) {
|
||||||
widget.deleteFav(currentStudent);
|
widget.deleteFav(currentStudent);
|
||||||
imageList.removeAt(defaultIndex);
|
imageList.removeAt(defaultIndex);
|
||||||
print('imageList.length=${imageList.length}');
|
|
||||||
print('defaultIndex=${defaultIndex}');
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if (imageList.length > 0) {
|
if (imageList.length > 0) {
|
||||||
if (defaultIndex < imageList.length) {
|
if (defaultIndex < imageList.length) {
|
||||||
|
|
@ -88,6 +89,7 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
||||||
currentStudent.studentName = '';
|
currentStudent.studentName = '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.r),
|
padding: EdgeInsets.symmetric(horizontal: 8.r),
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
loginName = userInfo['loginName'];
|
loginName = userInfo['loginName'];
|
||||||
});
|
});
|
||||||
});*/
|
});*/
|
||||||
if(widget.className != null){
|
if (widget.className != null) {
|
||||||
className = widget.className!;
|
className = widget.className!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,8 +66,8 @@ 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,
|
||||||
await _client.getListOfJobFavorites(widget.jobId, widget.jobName, className == '全部'?'':className, pageSize);
|
widget.jobName, className == '全部' ? '' : className, pageSize);
|
||||||
return result.data!.items;
|
return result.data!.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,10 +82,14 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
Future<void> getInvolveClasses() async {
|
Future<void> getInvolveClasses() async {
|
||||||
try {
|
try {
|
||||||
RestClient _client = await getClient();
|
RestClient _client = await getClient();
|
||||||
BaseStructureResult<List<JobReportJoinClass>> result = await _client.getJobReportJoinClasses(widget.jobId);
|
BaseStructureResult<List<JobReportJoinClass>> result =
|
||||||
|
await _client.getJobReportJoinClasses(widget.jobId);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
toUpState(setState, () {
|
toUpState(setState, () {
|
||||||
involveClasses = [JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1, '-1'), ...(result.data ?? [])];
|
involveClasses = [
|
||||||
|
JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1, '-1'),
|
||||||
|
...(result.data ?? [])
|
||||||
|
];
|
||||||
involveClasses?.forEach((element) {
|
involveClasses?.forEach((element) {
|
||||||
if (element.className == widget.className &&
|
if (element.className == widget.className &&
|
||||||
element.gradeId == widget.gradeId &&
|
element.gradeId == widget.gradeId &&
|
||||||
|
|
@ -101,26 +105,81 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteFav(Items student) async{
|
Future<bool> confirmDialog() async {
|
||||||
|
return await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
actionsPadding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
|
||||||
|
content: Text(
|
||||||
|
'确定删除吗?',
|
||||||
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505E6E)),
|
||||||
|
),
|
||||||
|
actionsAlignment: MainAxisAlignment.center,
|
||||||
|
actions: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
child: Container(
|
||||||
|
width: 97.r,
|
||||||
|
height: 27.r,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
|
color: Color(0xFF6888FD),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'确定',
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
))),
|
||||||
|
onTap: () {
|
||||||
|
// 执行操作
|
||||||
|
Navigator.of(context).pop(true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop(false);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 97.r,
|
||||||
|
height: 27.r,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
|
color: Color(0xFFF4F4F4),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(color: Color(0xFF666666)),
|
||||||
|
))),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getDelete(Items student) async {
|
||||||
RestClient _client = await getClient();
|
RestClient _client = await getClient();
|
||||||
BaseStructureResult res = await _client.getJobDeFavorites(widget.jobId,student.studentId,student.questionPage!);
|
BaseStructureResult res = await _client.getJobDeFavorites(
|
||||||
if(res.success){
|
widget.jobId, student.studentId, student.questionPage!);
|
||||||
|
if (res.success) {
|
||||||
_future = getData();
|
_future = getData();
|
||||||
setState(() {
|
setState(() {});
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showStudentDialog(BuildContext context,Items item,List groups) {
|
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(item: item,group: groups, deleteFav: deleteFav,),
|
content: FavoriteStudentDialog(
|
||||||
|
item: item,
|
||||||
|
group: groups,
|
||||||
|
deleteFav: getDelete,
|
||||||
|
confirmDialog: confirmDialog),
|
||||||
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))));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +192,9 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// titleSpacing: 0,
|
// titleSpacing: 0,
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
leading: IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: () => Navigator.of(context).pop()),
|
leading: IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back_ios),
|
||||||
|
onPressed: () => Navigator.of(context).pop()),
|
||||||
iconTheme: IconThemeData(color: Colors.black),
|
iconTheme: IconThemeData(color: Colors.black),
|
||||||
title: quickText('收藏夹'),
|
title: quickText('收藏夹'),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
|
@ -146,7 +207,7 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
if (datas == null)
|
if (datas == null)
|
||||||
return Container(
|
return Container(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
toUpState(setState, () => _future = getData(), mounted);
|
toUpState(setState, () => _future = getData(), mounted);
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
|
|
@ -163,10 +224,13 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
pageList = pageList.toSet().toList();
|
pageList = pageList.toSet().toList();
|
||||||
|
|
||||||
for (var page in pageList) {
|
for (var page in pageList) {
|
||||||
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']));
|
groupList
|
||||||
|
.sort((a, b) => a['questionPage'].compareTo(b['questionPage']));
|
||||||
}
|
}
|
||||||
return Container(
|
return Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -179,14 +243,17 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
widget.jobName,
|
widget.jobName,
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C)),
|
style:
|
||||||
|
TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C)),
|
||||||
),
|
),
|
||||||
// 下拉框
|
// 下拉框
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 10.h, horizontal: 10.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
$classSelection(involveClasses, classData, call: (JobReportJoinClass _classData) {
|
$classSelection(involveClasses, classData,
|
||||||
|
call: (JobReportJoinClass _classData) {
|
||||||
classData = _classData;
|
classData = _classData;
|
||||||
if (_classData.gradeId == -1) classData = null;
|
if (_classData.gradeId == -1) classData = null;
|
||||||
className = _classData.className;
|
className = _classData.className;
|
||||||
|
|
@ -207,62 +274,96 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
color: Color(0xFFCCCCCC),
|
color: Color(0xFFCCCCCC),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
groupList.length>0?
|
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: List.generate(groupList.length, (index) {
|
children:
|
||||||
|
List.generate(groupList.length, (index) {
|
||||||
var item = groupList[index];
|
var item = groupList[index];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 8.r),
|
padding: EdgeInsets.only(bottom: 8.r),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(bottom: 5.r),
|
padding:
|
||||||
|
EdgeInsets.only(bottom: 5.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
'第${item['questionPage']}页',
|
'第${item['questionPage']}页',
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF2E5BFF)),
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: Color(0xFF2E5BFF)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GridView(
|
GridView(
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
mainAxisSpacing: 8.r,
|
mainAxisSpacing: 8.r,
|
||||||
crossAxisSpacing: 10.r,
|
crossAxisSpacing: 10.r,
|
||||||
childAspectRatio: 556 / 112,
|
childAspectRatio: 556 / 112,
|
||||||
),
|
),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: List.generate(item['list'].length, (i){
|
children: List.generate(
|
||||||
|
item['list'].length, (i) {
|
||||||
Items student = item['list'][i];
|
Items student = item['list'][i];
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 5.r,
|
||||||
|
horizontal: 10.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
borderRadius:
|
||||||
|
BorderRadius.all(
|
||||||
|
Radius.circular(
|
||||||
|
6.r)),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showStudentDialog(context,student,groupList);
|
showStudentDialog(context,
|
||||||
|
student, groupList);
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
quickText(student.studentName, color: Color(0xFF333333), size: 12.sp),
|
quickText(
|
||||||
Expanded(child: Container()),
|
student.studentName,
|
||||||
|
color: Color(
|
||||||
|
0xFF333333),
|
||||||
|
size: 12.sp),
|
||||||
|
Expanded(
|
||||||
|
child: Container()),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(right: 8.r),
|
padding:
|
||||||
|
EdgeInsets.only(
|
||||||
|
right: 8.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
student.className,
|
student.className,
|
||||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF666666)),
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: Color(
|
||||||
|
0xFF666666)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
deleteFav(student);
|
var confim =
|
||||||
|
await confirmDialog();
|
||||||
|
if (confim) {
|
||||||
|
getDelete(
|
||||||
|
student);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/favorite_delete_icon.png',
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
|
@ -274,61 +375,80 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
})
|
})),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
})
|
})),
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var item = groupList[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(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(bottom: 5.r),
|
padding: EdgeInsets.only(bottom: 5.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
'第${item['questionPage']}页',
|
'第${item['questionPage']}页',
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF2E5BFF)),
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: Color(0xFF2E5BFF)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
itemBuilder: (context,i){
|
itemBuilder: (context, i) {
|
||||||
Items student = item['list'][i];
|
Items student = item['list'][i];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
showStudentDialog(context,student,groupList);
|
showStudentDialog(
|
||||||
|
context, student, groupList);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 5.r,
|
||||||
|
horizontal: 10.r),
|
||||||
margin: EdgeInsets.only(top: 5.r),
|
margin: EdgeInsets.only(top: 5.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.r)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
quickText(student.studentName, color: Color(0xFF333333), size: 14.sp),
|
quickText(student.studentName,
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
size: 14.sp),
|
||||||
Expanded(child: Container()),
|
Expanded(child: Container()),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(right: 8.r),
|
padding: EdgeInsets.only(
|
||||||
|
right: 8.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
student.className,
|
student.className,
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: Color(
|
||||||
|
0xFF666666)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
deleteFav(student);
|
var confim =
|
||||||
|
await confirmDialog();
|
||||||
|
if (confim) {
|
||||||
|
getDelete(student);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/favorite_delete_icon.png',
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
|
@ -340,16 +460,20 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},itemCount: item['list'].length,shrinkWrap: true,),
|
},
|
||||||
|
itemCount: item['list'].length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: groupList.length,
|
itemCount: groupList.length,
|
||||||
),
|
),
|
||||||
):Padding(
|
)
|
||||||
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
|
: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: MediaQuery.of(context).size.height / 2 - 200.r),
|
||||||
child: MyEmptyWidget(),
|
child: MyEmptyWidget(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -362,9 +486,11 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
|
||||||
|
|
||||||
/// 下拉选择框
|
/// 下拉选择框
|
||||||
@swidget
|
@swidget
|
||||||
Widget $classSelection(List<JobReportJoinClass>? involveClasses, JobReportJoinClass? classData,
|
Widget $classSelection(
|
||||||
|
List<JobReportJoinClass>? involveClasses, JobReportJoinClass? classData,
|
||||||
{required Function(JobReportJoinClass) call}) {
|
{required Function(JobReportJoinClass) call}) {
|
||||||
if (involveClasses == null) return Container(child: quickText('点击重试')); // 点击重试
|
if (involveClasses == null)
|
||||||
|
return Container(child: quickText('点击重试')); // 点击重试
|
||||||
return Container(
|
return Container(
|
||||||
// width: 200.r,
|
// width: 200.r,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
|
|
@ -383,14 +509,17 @@ Widget $classSelection(List<JobReportJoinClass>? involveClasses, JobReportJoinCl
|
||||||
items: involveClasses.map((e) {
|
items: involveClasses.map((e) {
|
||||||
return DropdownMenuItem(
|
return DropdownMenuItem(
|
||||||
value: e.uniqueId!,
|
value: e.uniqueId!,
|
||||||
child: quickText(e.uniqueId == '-1' ? e.graduationYear : e.graduationYear + e.className,
|
child: quickText(
|
||||||
size: 10.sp, color: Colors.black),
|
e.uniqueId == '-1'
|
||||||
|
? e.graduationYear
|
||||||
|
: e.graduationYear + e.className,
|
||||||
|
size: 10.sp,
|
||||||
|
color: Colors.black),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: (String? value) {
|
onChanged: (String? value) {
|
||||||
if (value == null) return;
|
if (value == null) return;
|
||||||
call(involveClasses.firstWhere((element) => element.uniqueId == value));
|
call(involveClasses.firstWhere((element) => element.uniqueId == value));
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -428,13 +428,13 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
|
||||||
if (jobData == null) return;
|
if (jobData == null) return;
|
||||||
if (!jobData!.sortLevel) {
|
if (!jobData!.sortLevel) {
|
||||||
jobData!.studentDetails.sort((a, b) {
|
jobData!.studentDetails.sort((a, b) {
|
||||||
return b.readLevel!
|
return a.readLevel!
|
||||||
.compareTo(a.readLevel!);
|
.compareTo(b.readLevel!);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
jobData!.studentDetails.sort((a, b) {
|
jobData!.studentDetails.sort((a, b) {
|
||||||
return a.readLevel!
|
return b.readLevel!
|
||||||
.compareTo(b.readLevel!);
|
.compareTo(a.readLevel!);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
jobData!.sortLevel =
|
jobData!.sortLevel =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue