YSCouponCommunity.dart 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'package:flutter/material.dart';
  2. import 'package:flutterappfuyou/code/base/YSBase.dart';
  3. import '../../base/YSTools.dart';
  4. import 'YSCommunityListItemView.dart';
  5. class YSCouponCommunity extends StatefulWidget {
  6. const YSCouponCommunity({Key key}) : super(key: key);
  7. @override
  8. _YSCouponCommunityState createState() => _YSCouponCommunityState();
  9. }
  10. class _YSCouponCommunityState extends State<YSCouponCommunity> {
  11. List _dataArray2= [];
  12. @override
  13. Widget build(BuildContext context) {
  14. return YSBase(
  15. ystitle: '社区体检券',
  16. yschild: NotificationListener<CustomerNotification>(
  17. onNotification: (value){
  18. refreshKey3.currentState.refresh();
  19. return true;
  20. },
  21. child: Container(
  22. height: ysHeight(context),
  23. width: ysWidth(context),
  24. child: YSRefreshLoad(
  25. key: refreshKey3,
  26. request: {'idcard':User().idCard},
  27. url: 'transfer/coupon/getCommunityVouchers',
  28. postData: (value){
  29. _dataArray2 = value;
  30. setState(() {});
  31. },
  32. dataWidget: SingleChildScrollView(
  33. child: ListView.separated(
  34. itemBuilder: (context,index){
  35. Map item = _dataArray2[index];
  36. return YSCommunityListItemView(item: item);
  37. },
  38. separatorBuilder: (context,index){
  39. return Container(height: 10,);
  40. },
  41. itemCount: _dataArray2.length,
  42. padding: EdgeInsets.only(top: 15,bottom: 15),
  43. shrinkWrap: true,
  44. physics: NeverScrollableScrollPhysics(),
  45. ),
  46. ),
  47. ),
  48. ),
  49. ),
  50. );
  51. }
  52. }