message_detail_model.dart 563 B

12345678910111213141516171819202122
  1. import 'dart:math';
  2. import 'package:sport/bean/post.dart';
  3. import 'package:sport/provider/lib/view_state_refresh_list_model.dart';
  4. import 'package:sport/services/api/inject_api.dart';
  5. class MessageDetailModel extends ViewStateRefreshListModel with InjectApi {
  6. final String type;
  7. String _read = "all";
  8. MessageDetailModel(this.type);
  9. readAll(){
  10. _read = "all";
  11. initData();
  12. }
  13. @override
  14. Future<List> loadData({int pageNum = 1}) async {
  15. return handlePage(await api.getNoticeList(type: type, page: max(1, pageNum), read: "$_read"));
  16. }
  17. }