flutter_upgrade_with_timesheet_changes
aamir-csol 1 day ago
parent deffeda015
commit e1f2819fe6

@ -25,16 +25,23 @@ class EITApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
// Check if GetEITTransactionList exists and is not empty
if (json['GetEITTransactionList'] == null || (json['GetEITTransactionList'] is List && json['GetEITTransactionList'].isEmpty)) {
return isCompleteList ? <List<CollectionTransaction>>[] : <CollectionTransaction>[];
}
if (isCompleteList) {
List<List<CollectionTransaction>> responseData = [];
json['GetEITTransactionList'].forEach((element) {
var transactionList = GetEitTransactionsModel.fromJson(element).collectionTransaction;
if (transactionList != null) responseData.add(transactionList);
if (transactionList != null && transactionList.isNotEmpty) {
responseData.add(transactionList);
}
});
return responseData;
} else {
List<CollectionTransaction>? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction;
return responseData;
return responseData ?? <CollectionTransaction>[];
}
},
url,

@ -115,13 +115,12 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
),
),
const SizedBox(height: 21),
dashboardProviderModel == null && dashboardProviderModel!.ticketHistoryTransactionList == null
? const SizedBox()
: ListView(
(dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty)
? ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
"Tickets History".toText20().expanded,
"Tickets History".toText20(),
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
@ -219,7 +218,8 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
itemCount: dashboardProviderModel!.ticketHistoryTransactionList!.length,
),
],
),
)
: const SizedBox(),
],
],
).expanded,

Loading…
Cancel
Save