You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
3.9 KiB
124 lines
3.9 KiB
import 'package:dating_touchme_app/components/page_appbar.dart';
|
|
import 'package:dating_touchme_app/extension/ex_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class PayFailPage extends StatefulWidget {
|
|
const PayFailPage({super.key});
|
|
|
|
@override
|
|
State<PayFailPage> createState() => _PayFailPageState();
|
|
}
|
|
|
|
class _PayFailPageState extends State<PayFailPage> {
|
|
|
|
int startTime = 0;
|
|
|
|
Future f1() async {
|
|
await Future.delayed(Duration(milliseconds: 500));
|
|
print("任务1完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
|
|
print("开始时间:${startTime}");
|
|
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
|
|
}
|
|
|
|
Future f2() async {
|
|
await Future.delayed(Duration(milliseconds: 500));
|
|
print("任务2完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
|
|
print("开始时间:${startTime}");
|
|
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
|
|
}
|
|
|
|
Future f3() async {
|
|
await Future.delayed(Duration(milliseconds: 500));
|
|
print("任务3完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
|
|
print("开始时间:${startTime}");
|
|
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
|
|
}
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: PageAppbar(title: "支付结果"),
|
|
body: SingleChildScrollView(
|
|
child: Container(
|
|
width: 375.w,
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 60.w
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: 70.w,
|
|
height: 70.w,
|
|
margin: EdgeInsets.only(bottom: 16.w),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(70.w)),
|
|
color: const Color.fromRGBO(248, 85, 66, 1)
|
|
),
|
|
child: Center(
|
|
child: Icon(
|
|
Icons.close,
|
|
size: 50.w,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
Text(
|
|
"交易失败",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
).onTap((){
|
|
startTime = DateTime.now().millisecondsSinceEpoch;
|
|
print("顺序写");
|
|
f1();
|
|
f2();
|
|
f3();
|
|
}),
|
|
SizedBox(height: 292.w,),
|
|
Container(
|
|
width: 150.w,
|
|
height: 30.w,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(30.w)),
|
|
color: const Color.fromRGBO(245, 245, 245, 1)
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
"联系客服",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
),
|
|
),
|
|
).onTap((){
|
|
startTime = DateTime.now().millisecondsSinceEpoch;
|
|
print("Future.wait");
|
|
Future.wait([
|
|
f1(),
|
|
f2(),
|
|
f3(),
|
|
]);
|
|
}),
|
|
SizedBox(height: 18.w,),
|
|
Text(
|
|
"返回",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1),
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
).onTap((){
|
|
Get.back();
|
|
})
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|