read method
Implementation
Future<void> read() async {
state.loading();
await UServices.hotel.readHotelReservations(
p: UHotelReservationReadParams(
pageNumber: pageNumber.value,
pageSize: pageSize,
hotelId: hotelFilter?.id ?? hotel?.id,
roomId: room?.id,
userName: guestFilter.text.nullIfEmpty(),
tags: _statusTag == null ? null : <int>[_statusTag!],
checkInDate: checkInFilter,
checkOutDate: checkOutFilter,
selectorArgs: const UHotelReservationSelectorArgs(
user: UUserSelectorArgs(),
room: UHotelRoomSelectorArgs(hotel: UHotelSelectorArgs()),
hotel: UHotelSelectorArgs(),
invoice: UHotelInvoiceSelectorArgs(),
),
),
onOk: (UResponse<List<UHotelReservationResponse>> r) {
list = r.result ?? <UHotelReservationResponse>[];
setTotalPages(r.totalCount);
setListState(isEmpty: list.isEmpty);
},
onError: (UResponse<dynamic> e) => setError(e.message),
onException: (String e) => setError(),
);
}