how manage status of 15 api calls with one state for screen with bloc pattern

35 Views Asked by At

i have a screen that it show data of 15 diffrent api what is best practice to manage state of each 15 api and pass them all with one state class from cubit

i tried create a folder for all statuses and add 15 diffrent status classes but app will be very complex i thought create nullable variable for all 15 api (all same model just diffrent data) in ticketlistsuccess and in ui if it had data show data else show loading what is best practice? this is my code (all response of API are TicketListModel)

class TicketListSuccess extends TicketListStatus {
  final List<

 1. TicketListModel

>? allTicketList;
  final List<TicketListModel>? assignedToMeTicket;
  final List<TicketListModel>? unassignedTicket;
  final List<TicketListModel>? closeTicket;
  final List<TicketListModel>? openTicket;
  final List<TicketListModel>? newTicket;
  
  TicketListSuccess({
    this.allTicketList,
    this.assignedToMeTicket,
    this.unassignedTicket,
    this.closeTicket,
    this.openTicket,
    this.newTicket,
  });
}
0

There are 0 best solutions below