import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'dart:ui';
import '../styles/totast.dart';
import '../net/HttpManager.dart';
import '../net/Result.dart';
import '../widget/LinearButton.dart';

class SuccessfulReception extends StatefulWidget {
  SuccessfulReception({Key key, this.money, this.playerId}) : super(key: key);
  final num money;
  final int playerId;
  @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: 294,
                  decoration: BoxDecoration(
                      border: Border.all(width: 1, color: Theme.of(context).primaryColor),
                      color: Color(0xFF15151D),
                      image: DecorationImage(image: AssetImage('images/img_guangmang1.png'), alignment: Alignment.topCenter, fit: BoxFit.contain)),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      Container(
                        height: 63,
                      ),
                      Image.asset(
                        'images/iocn_dajiafen.png',
                      ),
                      Container(
                        height: 25,
                      ),
                      Text('恭喜你获得${widget.money}积分', style: TextStyle(color: Color(0xFFD4504B), fontSize: 18, fontWeight: FontWeight.w600)),
                      Container(
                        height: 44,
                      ),
                      Padding(
                        padding: EdgeInsets.symmetric(horizontal: 25),
                        child: LinearButton(
                          btntext: '确定',
                          btnHeight: 36.0,
                          onTapHomeMenu: () {
                             Navigator.of(context).pop();
                          },
                        ),
                      ),
                    ],
                  )),
              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,
                ),
              ),
            ],
          )),
        ),
      ),
    );
  }
}
