SuccessfulReception.dart 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import 'package:flutter/material.dart';
  2. class SuccessfulReception extends StatefulWidget {
  3. SuccessfulReception({Key key, this.money}) : super(key: key);
  4. final int money;
  5. @override
  6. SuccessfulReceptionState createState() => SuccessfulReceptionState();
  7. }
  8. class SuccessfulReceptionState extends State<SuccessfulReception> {
  9. @override
  10. void initState() {
  11. super.initState();
  12. // Timer(Duration(seconds: 2), (){
  13. // Navigator.of(context).pop();
  14. // });
  15. }
  16. @override
  17. Widget build(BuildContext context) {
  18. return GestureDetector(
  19. onTap: () {
  20. Navigator.of(context).pop();
  21. },
  22. child: Scaffold(
  23. backgroundColor: Color(0xCC000000),
  24. body: Container(
  25. child: Center(
  26. child: Stack(
  27. children: <Widget>[
  28. Container(
  29. padding: EdgeInsets.only(top: 29, bottom: 49),
  30. width: 268,
  31. height: 160,
  32. decoration: BoxDecoration(
  33. border: Border.all(width: 1, color: Theme.of(context).primaryColor),
  34. image: DecorationImage(
  35. image: AssetImage('images/img_guangmang_1.png'),
  36. fit: BoxFit.cover)),
  37. child: Column(
  38. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  39. crossAxisAlignment: CrossAxisAlignment.center,
  40. children: <Widget>[
  41. Text('领取成功',
  42. style: TextStyle(
  43. color: Color(0xFFFDC372),
  44. fontSize: 18,
  45. fontWeight: FontWeight.w600)),
  46. Row(
  47. mainAxisAlignment: MainAxisAlignment.center,
  48. children: <Widget>[
  49. Image.asset('images/icon_jinbi_da_hong.png'),
  50. Text(' X ' + widget.money.toString(),
  51. style: TextStyle(
  52. color: Theme.of(context).primaryColor,
  53. fontSize: 32,
  54. fontWeight: FontWeight.w900))
  55. ],
  56. )
  57. ],
  58. )),
  59. Positioned(
  60. top: 0,
  61. left: 0,
  62. child: Image.asset(
  63. 'images/tancuang_shang.png',
  64. // width: 131,
  65. ),
  66. ),
  67. Positioned(
  68. bottom: 0,
  69. right: 4,
  70. child: Image.asset(
  71. 'images/tancuang_xia.png',
  72. // width: 148,
  73. ),
  74. ),
  75. ],
  76. )),
  77. ),
  78. ),
  79. );
  80. }
  81. }