SuccessfulReception.dart 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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: Color(0xFFC2524D)),
  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_xiao_hong.png',
  50. width: 39),
  51. Text(' X ' + widget.money.toString(),
  52. style: TextStyle(
  53. color: Color(0xFFC2524D),
  54. fontSize: 32,
  55. fontWeight: FontWeight.w900))
  56. ],
  57. )
  58. ],
  59. )),
  60. Positioned(
  61. top: 0,
  62. left: 0,
  63. child: Image.asset(
  64. 'images/tancuang_shang.png',
  65. width: 131,
  66. ),
  67. ),
  68. Positioned(
  69. bottom: 0,
  70. right: 4,
  71. child: Image.asset(
  72. 'images/tancuang_xia.png',
  73. width: 148,
  74. ),
  75. ),
  76. ],
  77. )),
  78. ),
  79. ),
  80. );
  81. }
  82. }