SuccessfulReception.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import 'package:flutter/material.dart';
  2. import 'dart:async';
  3. class SuccessfulReception extends StatefulWidget {
  4. SuccessfulReception({Key key, this.money}) : super(key: key);
  5. final int money;
  6. @override
  7. SuccessfulReceptionState createState() => SuccessfulReceptionState();
  8. }
  9. class SuccessfulReceptionState extends State<SuccessfulReception> {
  10. @override
  11. void initState() {
  12. super.initState();
  13. // Timer(Duration(seconds: 2), (){
  14. // Navigator.of(context).pop();
  15. // });
  16. }
  17. @override
  18. Widget build(BuildContext context) {
  19. return GestureDetector(
  20. onTap: () {
  21. Navigator.of(context).pop();
  22. },
  23. child: Scaffold(
  24. backgroundColor: Color(0xCC000000),
  25. body: Container(
  26. child: Center(
  27. child: Container(
  28. padding: EdgeInsets.only(top: 29, bottom: 49),
  29. width: 212,
  30. height: 220,
  31. decoration: BoxDecoration(
  32. image: DecorationImage(
  33. image: AssetImage('images/img_kaishiyouxi.png'),
  34. fit: BoxFit.fill)),
  35. child: Column(
  36. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  37. crossAxisAlignment: CrossAxisAlignment.center,
  38. children: <Widget>[
  39. Text('领取成功',
  40. style: TextStyle(
  41. color: Color(0xFFC2524D),
  42. fontSize: 20,
  43. fontWeight: FontWeight.w600)),
  44. Row(
  45. mainAxisAlignment: MainAxisAlignment.center,
  46. children: <Widget>[
  47. Image.asset('images/icon_jinbi_xiao_hong.png',
  48. width: 39),
  49. Text(' X ' + widget.money.toString(),
  50. style: TextStyle(
  51. color: Color(0xFFC2524D),
  52. fontSize: 32,
  53. fontWeight: FontWeight.w900))
  54. ],
  55. )
  56. ],
  57. ))),
  58. ),
  59. ),
  60. );
  61. }
  62. }