127 lines
3.8 KiB
Dart
127 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lottie/lottie.dart';
|
|
|
|
class LineUpDialog extends StatefulWidget {
|
|
final Function onTap;
|
|
final int num;
|
|
|
|
LineUpDialog(Key key, {required this.onTap, required this.num}) : super(key: key);
|
|
|
|
@override
|
|
LineUpDialogState createState() => LineUpDialogState();
|
|
}
|
|
|
|
class LineUpDialogState extends State<LineUpDialog> with SingleTickerProviderStateMixin {
|
|
int nub = 2;
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
nub = widget.num + 1;
|
|
}
|
|
|
|
void setNum(value) {
|
|
// if (value < nub) {
|
|
setState(() {
|
|
nub = value + 1;
|
|
});
|
|
// }
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final size = MediaQuery.of(context).size;
|
|
final h314 = size.width / 1.1464968152866;
|
|
final t29 = size.width / 12.413793103448;
|
|
final w130 = size.width / 2.7692307692307;
|
|
final w102 = size.width / 3.5294117647058;
|
|
final h32 = size.width / 11.25;
|
|
final t30 = size.width / 12;
|
|
final w193 = size.width / 1.8652849740932;
|
|
final h94 = size.width / 3.8297872340425;
|
|
final t10 = size.width / 36;
|
|
final s7 = size.width / 51.428571428571;
|
|
final w35 = size.width / 10.285714285714;
|
|
final s5 = size.width / 72;
|
|
final w40 = size.width / 9;
|
|
final h14 = size.width / 25.714285714285;
|
|
final t6 = size.width / 60;
|
|
|
|
return Material(
|
|
type: MaterialType.transparency,
|
|
color: const Color(0x1A000000),
|
|
child: Container(
|
|
color: Color(0x9017181A),
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: w193,
|
|
height: h94,
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(11), topRight: Radius.circular(11)),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(top: t10),
|
|
child: Text(
|
|
"排队中",
|
|
style: TextStyle(fontSize: s7, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: w35,
|
|
height: w35,
|
|
child: Lottie.asset(
|
|
'assets/animation/line_up.json',
|
|
repeat: true,
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 10),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
"您当前位于第",
|
|
style: TextStyle(fontSize: s5, color: Color(0xFF9D9D9D)),
|
|
),
|
|
Text(
|
|
" $nub ",
|
|
style: TextStyle(fontSize: s5, color: Color(0xFFFBB259)),
|
|
),
|
|
Text(
|
|
"位",
|
|
style: TextStyle(fontSize: 13, color: Color(0xFF9D9D9D)),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
widget.onTap();
|
|
},
|
|
child: Container(
|
|
width: w40,
|
|
height: h14,
|
|
margin: EdgeInsets.only(top: t6),
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF074CE7),
|
|
borderRadius: BorderRadius.all(Radius.circular(s7)),
|
|
),
|
|
child: Text(
|
|
"取消排队",
|
|
style: TextStyle(fontSize: t6, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|