| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import 'package:fast/constants.dart';
- import 'package:fast/utils/size_fit.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'component/navi_bar.dart';
- class PayResult extends StatefulWidget {
- bool success;
- PayResult({Key? key, required this.success}) : super(key: key);
- @override
- State<PayResult> createState() => _PayResultState();
- }
- class _PayResultState extends State<PayResult> {
- void tapDone() {
- if (widget.success) {
- Get.close(2);
- } else {
- Get.back();
- }
- }
- @override
- Widget build(BuildContext context) {
- SizeFit.initialize(context);
- return Material(
- color: kBgColor,
- child: Column(
- children: [
- NaviBar(
- title: '充值',
- closeCallback: () {
- Get.back();
- }),
- SizedBox(
- height: 64.px,
- ),
- Image.asset(
- widget.success
- ? 'assets/images/pay_success.png'
- : 'assets/images/pay_fail.png',
- width: 96.px,
- height: 96.px,
- ),
- SizedBox(
- height: 20.px,
- ),
- Text(
- widget.success ? '充值成功' : '充值失败',
- style: TextStyle(
- color: Colors.white,
- fontSize: 24.px,
- fontWeight: FontWeight.bold),
- ),
- SizedBox(
- height: 64.px,
- ),
- GestureDetector(
- onTap: () {
- tapDone();
- },
- child: Container(
- alignment: Alignment.center,
- width: 160.px,
- height: 48.px,
- decoration: BoxDecoration(
- border: Border.all(color: kThemeColor, width: 2.px),
- borderRadius: BorderRadius.all(Radius.circular(24.px))),
- child: Text(
- widget.success ? '完成' : '返回重试',
- style: TextStyle(
- color: kThemeColor,
- fontWeight: FontWeight.bold,
- fontSize: 16.px),
- ),
- ),
- )
- ],
- ),
- );
- }
- }
|