1234567891011121314151617181920212223242526272829303132333435 |
- 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<ScoreListData> with InjectApi{
- List<ScoreListData> scoreList = [];
- @override
- Future<List<ScoreListData>> loadData({int pageNum=0}) async{
- List<ScoreListData>? _list = (await api.getScoreIndex()).data?.data;
- scoreList = _list ?? [];
- return scoreList;
- }
- }
|