requestHomeClsQueryById static method

dynamic requestHomeClsQueryById(
  1. int? id,
  2. int pageNo,
  3. int pageSize,
  4. dynamic callBack(
    1. List<LiveRoomModel>?
    ),
)

非固定分类查询列表 id 非固定分类id pageNo 页码 pageSize 条数 callBack 返回结果

Implementation

static requestHomeClsQueryById(int? id, int pageNo, int pageSize, Function(List<LiveRoomModel>?) callBack) {
  DioManager().requestList<dynamic>(RequestType.POST, RequestApi.apiHomeClsQueryById,
      params: {'id': id, 'pageNo': pageNo, 'pageSize': pageSize}, onSuccess: (data) {
    List<LiveRoomModel> itemList = [];
    for (var item in data) {
      itemList.add(LiveRoomModel.fromJson(item));
    }
    callBack(itemList);
  }, onError: (error) {
    callBack(null);
  });
}