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 {
    ShopIndex shopIndex = (await api.getShopIndex()).data;
    // return shopIndex;
    shop = shopIndex;
    setIdle();
    return shop;
  }
}

class ScoreModel extends ViewStateRefreshListModel<ScoreListData> with InjectApi{
  List<ScoreListData> scoreList;

  @override
  Future<List<ScoreListData>> loadData({int pageNum}) async{
    // TODO: implement loadData
      List<ScoreListData> _list = (await api.getScoreIndex()).data.data;
      scoreList = _list;
      setIdle();
      return scoreList;
  }
}