import 'dart:math'; import 'package:sport/bean/post.dart'; import 'package:sport/provider/lib/view_state_refresh_list_model.dart'; import 'package:sport/services/api/inject_api.dart'; class MessageDetailModel extends ViewStateRefreshListModel with InjectApi { final String type; String _read = "all"; MessageDetailModel(this.type); readAll() { _read = "all"; initData(); } @override Future loadData({int pageNum = 1}) async { return handlePage(await api.getNoticeList( type: type, page: max(1, pageNum), read: "$_read")); } }