441 lines
20 KiB
Dart
441 lines
20 KiB
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../beans/sign_list_bean.dart';
|
|
|
|
///签到弹窗
|
|
class SignDialog extends StatefulWidget {
|
|
final Function onTap;
|
|
final List<SignListBean> list;
|
|
|
|
const SignDialog({super.key, required this.onTap, required this.list});
|
|
|
|
@override
|
|
State<SignDialog> createState() => _SignDialogState();
|
|
}
|
|
|
|
class _SignDialogState extends State<SignDialog> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: MaterialType.transparency, //透明类型
|
|
color: Color(0x1A000000),
|
|
child: Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 331,
|
|
height: 410,
|
|
decoration: BoxDecoration(image: DecorationImage(image: AssetImage('assets/images/sign_bg.png'))),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
alignment: Alignment.centerRight,
|
|
width: double.infinity,
|
|
margin: EdgeInsets.only(top: 21, right: 13),
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: Image(
|
|
width: 16,
|
|
height: 16,
|
|
image: AssetImage('assets/images/ic_cross.png'),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 34),
|
|
child: Wrap(
|
|
children: [
|
|
///1
|
|
Container(
|
|
width: 99,
|
|
height: 103,
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[0].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"1",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 99,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[0].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[0].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///2
|
|
Container(
|
|
width: 99,
|
|
height: 103,
|
|
margin: EdgeInsets.only(left: 8),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[1].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"2",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 99,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[1].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[1].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///3
|
|
Container(
|
|
width: 99,
|
|
height: 103,
|
|
margin: EdgeInsets.only(left: 8),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[2].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"3",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 99,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[2].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[2].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///4
|
|
Container(
|
|
width: 99,
|
|
height: 103,
|
|
margin: EdgeInsets.only(top: 7),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[3].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"4",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 99,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[3].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[3].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///5
|
|
Container(
|
|
width: 207,
|
|
height: 103,
|
|
margin: EdgeInsets.only(left: 8, top: 7),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[4].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"5",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 207,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[4].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[4].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s2.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///6
|
|
Container(
|
|
width: 99,
|
|
height: 103,
|
|
margin: EdgeInsets.only(top: 7),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[5].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"6",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 99,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[5].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[5].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
|
|
///7
|
|
Container(
|
|
width: 207,
|
|
height: 103,
|
|
margin: EdgeInsets.only(left: 8, top: 7),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
CachedNetworkImage(
|
|
imageUrl: '${widget.list[6].image}',
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
child: Container(
|
|
width: 23,
|
|
height: 23,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF17181A),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(2), bottomRight: Radius.circular(5)),
|
|
),
|
|
child: Text(
|
|
"7",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
child: Container(
|
|
width: 207,
|
|
height: 25,
|
|
color: Color(0x4D000000),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"${widget.list[6].signName}",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
widget.list[6].status == 1
|
|
? Image(
|
|
image: AssetImage('assets/images/ic_sign_s2.png'),
|
|
)
|
|
: Container(),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
///领取
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
widget.onTap();
|
|
},
|
|
child: Container(
|
|
width: 154,
|
|
height: 47,
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.only(top: 16),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF074CE7),
|
|
borderRadius: BorderRadius.all(Radius.circular(24)),
|
|
),
|
|
child: Text(
|
|
"领取",
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|