SuccessfulReception.dart 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: Stack(
  28. children: <Widget>[
  29. Container(
  30. padding: EdgeInsets.only(top: 29, bottom: 49),
  31. width: 268,
  32. height: 160,
  33. decoration: BoxDecoration(
  34. border: Border.all(width: 1, color: Color(0xFFC2524D)),
  35. image: DecorationImage(
  36. image: AssetImage('images/img_guangmang_1.png'),
  37. fit: BoxFit.cover)),
  38. child: Column(
  39. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  40. crossAxisAlignment: CrossAxisAlignment.center,
  41. children: <Widget>[
  42. Text('领取成功',
  43. style: TextStyle(
  44. color: Color(0xFFFDC372),
  45. fontSize: 18,
  46. fontWeight: FontWeight.w600)),
  47. Row(
  48. mainAxisAlignment: MainAxisAlignment.center,
  49. children: <Widget>[
  50. Image.asset('images/icon_jinbi_xiao_hong.png',
  51. width: 39),
  52. Text(' X ' + widget.money.toString(),
  53. style: TextStyle(
  54. color: Color(0xFFC2524D),
  55. fontSize: 32,
  56. fontWeight: FontWeight.w900))
  57. ],
  58. )
  59. ],
  60. )),
  61. Positioned(
  62. top: 0,
  63. left: 0,
  64. child: Image.asset(
  65. 'images/tancuang_shang.png',
  66. width: 131,
  67. ),
  68. ),
  69. Positioned(
  70. bottom: 0,
  71. right: 4,
  72. child: Image.asset(
  73. 'images/tancuang_xia.png',
  74. width: 148,
  75. ),
  76. ),
  77. ],
  78. )),
  79. ),
  80. ),
  81. );
  82. }
  83. }