|
|
|
|
@ -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;
|
|
|
|
|
|