import 'package:flutter/material.dart';

class SuccessfulReception extends StatefulWidget {
  SuccessfulReception({Key key, this.money}) : super(key: key);
  final int money;
  @override
  SuccessfulReceptionState createState() => SuccessfulReceptionState();
}

class SuccessfulReceptionState extends State<SuccessfulReception> {
  @override
  void initState() {
    super.initState();
    // Timer(Duration(seconds: 2), (){
    //   Navigator.of(context).pop();
    // });
  }

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Navigator.of(context).pop();
      },
      child: Scaffold(
        backgroundColor: Color(0xCC000000),
        body: Container(
          child: Center(
              child: Stack(
                children: <Widget>[
                  Container(
                  padding: EdgeInsets.only(top: 29, bottom: 49),
                  width: 268,
                  height: 160,
                  decoration: BoxDecoration(
                      border: Border.all(width: 1, color: Color(0xFFC2524D)),
                      image: DecorationImage(
                          image: AssetImage('images/img_guangmang_1.png'),
                          fit: BoxFit.cover)),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      Text('领取成功',
                          style: TextStyle(
                              color: Color(0xFFFDC372),
                              fontSize: 18,
                              fontWeight: FontWeight.w600)),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          Image.asset('images/icon_jinbi_xiao_hong.png',
                              width: 39),
                          Text(' X ' + widget.money.toString(),
                              style: TextStyle(
                                  color: Color(0xFFC2524D),
                                  fontSize: 32,
                                  fontWeight: FontWeight.w900))
                        ],
                      )
                    ],
                  )),
                   Positioned(
                      top: 0,
                      left: 0,
                      child: Image.asset(
                        'images/tancuang_shang.png',
                        width: 131,
                      ),
                    ),
                    Positioned(
                      bottom: 0,
                      right: 4,
                      child: Image.asset(
                        'images/tancuang_xia.png',
                        width: 148,
                      ),
                    ),
                ],
              )),
        ),
      ),
    );
  }
}
