import 'package:sport/provider/lib/view_state_refresh_list_model.dart';
import 'package:sport/services/api/inject_api.dart';

typedef FutureCreate = Future<List> Function(int pageNum);

class SimpleModel extends ViewStateRefreshListModel with InjectApi {
  final FutureCreate create;

  SimpleModel(this.create);

  @override
  Future<List> loadData({int pageNum}) async {
    var result;
    try {
      result = create.call(pageNum);
    } catch (e) {
      print(e);
    }
    return result;
  }
}
