YSCouponHelp.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:flutter/material.dart';
  2. import 'package:flutterappfuyou/code/base/YSBase.dart';
  3. import 'package:flutterappfuyou/code/base/YSTools.dart';
  4. import '../base/YSNetWorking.dart';
  5. class YSCouponHelp extends StatefulWidget {
  6. const YSCouponHelp({Key key}) : super(key: key);
  7. @override
  8. _YSCouponHelpState createState() => _YSCouponHelpState();
  9. }
  10. class _YSCouponHelpState extends State<YSCouponHelp> {
  11. List _dataArray = [];
  12. @override
  13. void initState() {
  14. Future.delayed(Duration(seconds: 0)).then((value) {
  15. _getHelpData();
  16. });
  17. super.initState();
  18. }
  19. _getHelpData() async{
  20. Map dict = await ysRequestHttp(context, requestType.post, 'transfer/coupon/getPictures', {'idcard':User().idCard,'type':'CONSUMPTION_ASSISTANCE'});
  21. if(dict!=null){
  22. _dataArray = dict['data']??[];
  23. // LogUtil.d(_dataArray);
  24. setState(() {});
  25. }
  26. }
  27. @override
  28. Widget build(BuildContext context) {
  29. return YSBase(
  30. ystitle: '使用帮助',
  31. yschild: ListView.builder(
  32. itemBuilder: (context,index){
  33. String url = _dataArray[index];
  34. // LogUtil.d(url);
  35. return Image.network(url,fit: BoxFit.fill,key: Key('help'),);
  36. },
  37. itemCount: _dataArray.length,
  38. padding: EdgeInsets.all(0),
  39. ),
  40. );
  41. }
  42. }