YSInstitution.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import 'package:flutter/material.dart';
  2. import 'package:flutterappfuyou/code/base/YSBase.dart';
  3. import 'package:flutterappfuyou/code/base/YSTools.dart';
  4. import 'package:flutterappfuyou/code/version3/view/YSInstitutionListItemView.dart';
  5. import 'package:flutterappfuyou/code/version3/view/YSSearchView.dart';
  6. import 'package:flutter_webview_pro/webview_flutter.dart';
  7. import '../base/YSNetWorking.dart';
  8. class YSInstitution extends StatefulWidget {
  9. const YSInstitution({Key key}) : super(key: key);
  10. @override
  11. _YSInstitutionState createState() => _YSInstitutionState();
  12. }
  13. class _YSInstitutionState extends State<YSInstitution> with SingleTickerProviderStateMixin{
  14. List _dataArray = [];
  15. @override
  16. void initState() {
  17. Future.delayed(Duration(seconds: 0)).then((value) {
  18. _getInstitutionData();
  19. });
  20. super.initState();
  21. }
  22. _getInstitutionData() async{
  23. Map dict = await ysRequestHttpNoLoading(context, requestType.post, 'transfer/coupon/getRecommendedHospitals', {'idcard':User().idCard});
  24. if(dict!=null){
  25. _dataArray = dict['data']??[];
  26. setState(() {});
  27. }
  28. }
  29. @override
  30. Widget build(BuildContext context) {
  31. return YSBase(
  32. ystitle: '机构列表',
  33. ysBgColor: Color(0xFFF1F1F1),
  34. yschild: Container(
  35. height: ysHeight(context)-ysTOP(context)-100,
  36. child: ListView.separated(itemBuilder: (context,index){
  37. Map item = _dataArray[index];
  38. return YSInstitutionListItemView(item: item,);
  39. },
  40. separatorBuilder: (context,index){
  41. return Container(height: 15,);
  42. },
  43. itemCount: _dataArray.length,padding: EdgeInsets.only(left: 15,right: 15,bottom: 15,top: 15),),
  44. )
  45. ,
  46. );
  47. }
  48. }