sport_history_model.dart 498 B

12345678910111213141516
  1. import 'dart:math';
  2. import 'package:sport/bean/sport_detail.dart';
  3. import 'package:sport/provider/lib/view_state_refresh_list_model.dart';
  4. import 'package:sport/services/api/inject_api.dart';
  5. class SportHistoryModel extends ViewStateRefreshListModel<RecordsTodaySum> with InjectApi {
  6. final int id;
  7. SportHistoryModel(this.id);
  8. @override
  9. Future<List<RecordsTodaySum>> loadData({int pageNum=0}) async {
  10. return handlePage(await api.getSportRecordList(id, page: max(1, pageNum)));
  11. }
  12. }