QIPS-1205

etqan_ovr_integration
aamir-csol 1 day ago
parent 9f663df3cc
commit 71d03ba664

@ -72,13 +72,12 @@ class EtqanApiClient {
DateFormat dateFormat = DateFormat("dd-MMM-yyyy hh:mm a");
DateTime dateA = dateFormat.parse(a.createdDate!);
DateTime dateB = dateFormat.parse(b.createdDate!);
return dateB.compareTo(dateA);
return dateA.compareTo(dateB);
} catch (e) {
return (b.createdDate ?? '').compareTo(a.createdDate ?? '');
}
});
}
return responseData;
},
url,

@ -1,5 +1,6 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/etqan_ovr_api_client.dart';
@ -71,6 +72,7 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
localeId: localeId,
listenFor: const Duration(seconds: 30),
pauseFor: const Duration(seconds: 3),
partialResults: true,
listenMode: ListenMode.confirmation,
);
_isListening = true;
@ -191,8 +193,21 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Utils.hideLoading(context);
if (response != null) {
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();
notifyListeners();
if (getEtqanEmployeeRequestsList != null) {
getEtqanEmployeeRequestsList!.sort((EtqanGetEmployeeOvrRequestsResponse a, EtqanGetEmployeeOvrRequestsResponse b) {
if (a.createdDate == null && b.createdDate == null) return 0;
if (a.createdDate == null) return 1;
if (b.createdDate == null) return -1;
try {
DateFormat dateFormat = DateFormat("dd-MMM-yyyy hh:mm a");
DateTime dateA = dateFormat.parse(a.createdDate!);
DateTime dateB = dateFormat.parse(b.createdDate!);
return dateA.compareTo(dateB);
} catch (e) {
return (b.createdDate ?? '').compareTo(a.createdDate ?? '');
}
});
}
return response;
}
return null;

@ -303,7 +303,7 @@ class _EtqanOvrCreateRequestState extends State<EtqanOvrCreateRequest> {
children: <Widget>[
Container(width: 8, height: 8, decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(4))),
const SizedBox(width: 8),
Text('Listening...', style: TextStyle(fontSize: 12, color: MyColors.gradiantEndColor, fontWeight: FontWeight.w500)),
const Text('Listening...', style: TextStyle(fontSize: 12, color: MyColors.gradiantEndColor, fontWeight: FontWeight.w500)),
],
),
),

@ -69,7 +69,7 @@ class _EtqanOvrHomeState extends State<EtqanOvrHome> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
(data.ticketNumber ?? "").toText14(isBold: true, color: MyColors.darkTextColor),
Directionality(textDirection: TextDirection.ltr, child: (data.createdDate!.split(" ").first ?? "").toText12(color: MyColors.grey70Color)),
Directionality(textDirection: TextDirection.ltr, child: (data.createdDate! ?? "").toText12(color: MyColors.grey70Color)),
],
),
8.height,

Loading…
Cancel
Save