comment_sub_list_model.dart 674 B

123456789101112131415161718
  1. import 'dart:math';
  2. import 'package:sport/bean/comment.dart';
  3. import 'package:sport/bean/post.dart';
  4. import 'package:sport/provider/lib/view_state_refresh_list_model.dart';
  5. import 'package:sport/services/api/inject_api.dart';
  6. class CommentSubListModel extends ViewStateRefreshListModel with InjectApi {
  7. final Comment _comment;
  8. CommentSubListModel(this._comment);
  9. @override
  10. Future<List> loadData({int pageNum = 1}) async {
  11. // return (await api.getPostCommentSubs(_comment.id, page: 1)).pageResult.results.where((element) => !list.any((e) => e.id == element.id)).toList();
  12. return handlePage(await api.getPostCommentSubs(_comment.id!, page: pageNum));
  13. }
  14. }