import 'package:flutter/cupertino.dart'; import 'package:sport/bean/user_friend.dart'; import 'package:sport/provider/lib/view_state_list_model.dart'; import 'package:sport/services/api/inject_api.dart'; import 'package:sport/bean/shop.dart'; import 'lib/view_state_model.dart'; import 'lib/view_state_refresh_list_model.dart'; class ShopModel extends ViewStateModel with InjectApi { ShopIndex? shop; init() async { try { ShopIndex? shopIndex = (await api.getShopIndex()).data; // return shopIndex; shop = shopIndex; setIdle(); } catch (e) { print(e); setEmpty(); } return shop; } } class ScoreModel extends ViewStateRefreshListModel with InjectApi{ List scoreList = []; @override Future> loadData({int pageNum=0}) async{ List? _list = (await api.getScoreIndex()).data?.data; scoreList = _list ?? []; return scoreList; } }