75 lines
2.8 KiB
Dart
75 lines
2.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:school_asignment_app/common/job/homework_details.dart';
|
|
import 'package:school_asignment_app/page/global_widget/my_text.dart';
|
|
import 'package:school_asignment_app/routes/app_pages.dart';
|
|
|
|
class ShowStudentList extends StatelessWidget {
|
|
final String title;
|
|
final String homeworkId;
|
|
final List<dynamic> studentList;
|
|
const ShowStudentList({Key? key,required this.title,required this.studentList,required this.homeworkId}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
backgroundColor: Colors.white,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
|
),
|
|
content: Container(
|
|
width: Get.width * 0.8,
|
|
height: Get.height * 0.7,
|
|
padding: EdgeInsets.symmetric(horizontal: 2.w),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(top: 14.h),
|
|
child: quickText(
|
|
title,
|
|
size: 18.sp,
|
|
fontWeight: FontWeight.bold,
|
|
color: Color.fromRGBO(60, 60, 60, 1),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: ListView(
|
|
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w),
|
|
children: [
|
|
Wrap(
|
|
spacing: 6.r, // 主轴(水平)方向间距
|
|
runSpacing: 4.r, // 纵轴(垂直)方向间距
|
|
alignment: WrapAlignment.spaceAround, //沿主轴方向居中
|
|
children: studentList.map((e) {
|
|
return InkWell(
|
|
onTap: (){
|
|
Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':e.studentId,'homeworkId':homeworkId});
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 4.r, horizontal: 8.r),
|
|
decoration: BoxDecoration(
|
|
color: e.state == 3
|
|
? Color(0xFF4CC793)
|
|
: Color(0xFFE2E2E2),
|
|
borderRadius: BorderRadius.circular(4.r),
|
|
),
|
|
child: quickText(e.studentName,
|
|
color:
|
|
e.state == 3 ? Colors.white : Color(0xFF505E6E),
|
|
size: 10.sp),
|
|
),
|
|
);
|
|
}).toList(),
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|