Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-haroon

dq_and_master
haroon amjad 4 years ago
commit f394433b6e

@ -1 +1 @@
f4a819c27119d0f472892c1088ad1ca3 d69545ca05f0ca200eba92121a1458fb

@ -38,8 +38,8 @@ const GET_PRESCRIPTION_REPORT_ENH =
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults'; 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT = const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
'Services/Patients.svc/REST/GetPatientLabResults'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';

@ -1134,4 +1134,24 @@ const Map localizedValues = {
"en":"A copy has been sent to the email", "en":"A copy has been sent to the email",
"ar":"تم إرسال نسخة إلى البريد الإلكتروني" "ar":"تم إرسال نسخة إلى البريد الإلكتروني"
}, },
"instructions": {
"en": "You can now talk directly to the appointments department by chat or request a call back",
"ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال"
},
"instructions-pharmacies": {
"en": "You can now talk directly to the pharmacist by chat or request a call back",
"ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال"
},
"select-hospital": {
"en": "Choose Hospital",
"ar": "اختر المستشفى"
},
"start": {
"en": "Start",
"ar": "ابدأ"
},
"info-chat": {
"en": "This service allows you to chat with customer service directly without the need to call.",
"ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً."
},
}; };

@ -0,0 +1,88 @@
class LabOrderResult {
String description;
dynamic femaleInterpretativeData;
int gender;
int lineItemNo;
dynamic maleInterpretativeData;
dynamic notes;
String packageID;
int patientID;
String projectID;
String referanceRange;
String resultValue;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
dynamic superVerifiedOn;
String testCode;
String uOM;
String verifiedOn;
String verifiedOnDateTime;
LabOrderResult(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabOrderResult.fromJson(Map<String, dynamic> json) {
description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender'];
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
packageID = json['PackageID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
superVerifiedOn = json['SuperVerifiedOn'];
testCode = json['TestCode'];
uOM = json['UOM'];
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;
data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes;
data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
data['SuperVerifiedOn'] = this.superVerifiedOn;
data['TestCode'] = this.testCode;
data['UOM'] = this.uOM;
data['VerifiedOn'] = this.verifiedOn;
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
}

@ -47,15 +47,8 @@ class BaseAppClient {
} }
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID') body['LanguageID'] = languageID == 'ar' ? 1 : 2;
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'en'
? 2
: 1;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;

@ -8,6 +8,7 @@ class LiveChatService extends BaseService {
List<GetPatientICProjectsModel> LivechatModelList = List(); List<GetPatientICProjectsModel> LivechatModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['body']
Future getAllLiveChatOrders() async { Future getAllLiveChatOrders() async {
hasError = false; hasError = false;

@ -13,14 +13,13 @@ class HospitalService extends BaseService {
double _longitude; double _longitude;
_getCurrentLocation() async { _getCurrentLocation() async {
await getLastKnownPosition().then((value) { await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
_longitude = 0; _longitude = 0;
_latitude = 0; _latitude = 0;
}); });
// currentLocation = LatLng(position.latitude, position.longitude);
} }
Future getHospitals() async { Future getHospitals() async {

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
@ -32,7 +33,7 @@ class LabsService extends BaseService {
List<PatientLabSpecialResult> patientLabSpecialResult = List(); List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult( Future getLaboratoryResult(
{String projectID, {String projectID,
@ -88,11 +89,11 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.post(GET_Patient_LAB_RESULT, await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart';
import 'package:geolocator/geolocator.dart';
class PharmacyService extends BaseService { class PharmacyService extends BaseService {
List<PharmaciesModel> _medicineItem = List(); List<PharmaciesModel> _medicineItem = List();
@ -59,10 +60,29 @@ class PharmacyService extends BaseService {
projectID: 15, projectID: 15,
); );
double _latitude;
double _longitude;
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
Future getMedicineList({String drugName}) async { Future getMedicineList({String drugName}) async {
hasError = false; hasError = false;
_requestGetPharmaciesModel.pHRItemName = drugName; // await _getCurrentLocation();
try { Map<String,dynamic> body = Map();
body['PHR_itemName'] = drugName;
body['isLoginForDoctorApp'] = true;
body['isDentalAllowedBackend'] = true;
// body['Latitude'] = _latitude;
// body['Longitude'] = _longitude;
await baseAppClient.post(GET_PHARMCY_ITEMS, await baseAppClient.post(GET_PHARMCY_ITEMS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_medicineItem.clear(); _medicineItem.clear();
@ -72,15 +92,18 @@ class PharmacyService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestGetPharmaciesModel.toJson()); }, body: body);
} catch (error) {
throw error;
}
} }
Future getPharmaciesList({int itemID}) async { Future getPharmaciesList({int itemID}) async {
_pharmaciesListModel.itemID = itemID;
try { await _getCurrentLocation();
Map<String,dynamic> body = Map();
body['ItemID'] = itemID;
body['Latitude'] = _latitude;
body['Longitude'] = _longitude;
await baseAppClient.post(GET_PHARMACY_LIST, await baseAppClient.post(GET_PHARMACY_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_pharmaciesList.clear(); _pharmaciesList.clear();
@ -91,9 +114,7 @@ class PharmacyService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _pharmaciesListModel.toJson()); }, body:body);
} catch (error) {
throw error;
}
} }
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
@ -12,7 +13,7 @@ class LabsViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
LabsService _labsService = locator<LabsService>(); LabsService _labsService = locator<LabsService>();
List<LabResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();

@ -23,9 +23,11 @@ class PharmacyViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
//_pharmacyService.clearPharmaciesList();
} }
clearMedicineSearch(){
_pharmacyService.clearMedicineList();
}
Future getMedicine({String name}) async { Future getMedicine({String name}) async {
hasError = false; hasError = false;
_pharmacyService.clearMedicineList(); _pharmacyService.clearMedicineList();

@ -30,7 +30,6 @@ class ProjectViewModel extends BaseViewModel {
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
// BaseViewModel baseViewModel = locator<BaseViewModel>()
StreamSubscription subscription; StreamSubscription subscription;
ProjectViewModel() { ProjectViewModel() {
@ -54,7 +53,7 @@ class ProjectViewModel extends BaseViewModel {
}); });
} }
void loadSharedPrefLanguage() async { Future loadSharedPrefLanguage() async {
currentLanguage = currentLanguage =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_appLocale = Locale(currentLanguage); _appLocale = Locale(currentLanguage);

@ -1,11 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -27,13 +31,14 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LiveChatViewModel>( return BaseView<LiveChatViewModel>(
onModelReady: (model) => model.getLiveChatRequestOrders(), onModelReady: (model) => model.getLiveChatRequestOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -43,11 +48,11 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 20, height: 70,
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: 200, height: 230,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage(
@ -56,10 +61,29 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Column(
'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.white, children: [
textAlign: TextAlign.start, SizedBox(
height: projectViewModel.isArabic? 10:20,
),
Texts(
TranslationBase.of(context).instructions,
color: Colors.white,
textAlign: TextAlign.start,
),
SizedBox(
height:projectViewModel.isArabic? 8:25,
),
Texts(
TranslationBase.of(context)
.selectHospitalDec +
" :",
color: Colors.white,
fontWeight: FontWeight.w700,
textAlign: TextAlign.start,
),
],
), ),
), ),
), ),
@ -91,7 +115,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5)), Radius.circular(5)),
color: tappedIndex == index color: tappedIndex == index
? Colors.red ? Theme.of(context).primaryColor
: Colors.white, : Colors.white,
), ),
child: Padding( child: Padding(
@ -104,8 +128,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
onTap: () { onTap: () {
setState(() { setState(() {
tappedIndex = index; tappedIndex = index;
chat = chat = "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}";
"http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}";
}); });
}, },
child: Row( child: Row(
@ -135,7 +158,8 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
.black, .black,
textAlign: TextAlign textAlign: TextAlign
.center, .center,
))), //model.cOCItemList[index].cOCTitl ))),
//model.cOCItemList[index].cOCTitl
IconButton( IconButton(
icon: Icon( icon: Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
@ -171,18 +195,19 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Center( child: Center(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.of(context).size.height * 0.07,
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: SecondaryButton(
label: 'ٍStart', label: TranslationBase.of(context).start,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
textColor: Colors.white,
disabled: chat.isEmpty,
onTap: () { onTap: () {
print("chat=" + chat);
launch(chat); launch(chat);
}, },
), ),

@ -1,6 +1,8 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -16,9 +18,15 @@ class LiveChatPage extends StatefulWidget {
class _LiveChatPageState extends State<LiveChatPage> class _LiveChatPageState extends State<LiveChatPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png'));
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
} }
@ -33,7 +41,10 @@ class _LiveChatPageState extends State<LiveChatPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Locations', imagesInfo: imagesInfo,
title: TranslationBase.of(context).liveChat,
description: TranslationBase.of(context).infoChat,
appBarTitle: TranslationBase.of(context).service,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -71,25 +82,22 @@ class _LiveChatPageState extends State<LiveChatPage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
//indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Theme.of(context).primaryColor,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: Center( child: Center(
child: Texts(' Hospitals '), child: Texts(TranslationBase.of(context).hospitals),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: Center( child: Center(
child: Texts(' Pharmacies '), child: Texts(TranslationBase.of(context).pharmacies),
), ),
), ),
], ],

@ -1,12 +1,15 @@
import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -28,10 +31,11 @@ class _PhamaciesLiveChatPageState extends State<PhamaciesLiveChatPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LiveChatViewModel>( return BaseView<LiveChatViewModel>(
onModelReady: (model) => model.getLiveChatRequestOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
@ -43,12 +47,9 @@ class _PhamaciesLiveChatPageState extends State<PhamaciesLiveChatPage> {
Container( Container(
width: double.infinity, width: double.infinity,
height: 200, height: 200,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(''), fit: BoxFit.cover),
),
child: Texts( child: Texts(
'You can now talk directly to the pharmacist by chat or request a call back', TranslationBase.of(context).instructionsPharmacies,
color: Colors.black, color: Colors.black,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -63,20 +64,20 @@ class _PhamaciesLiveChatPageState extends State<PhamaciesLiveChatPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Center( child: Center(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.of(context).size.height * 0.87,
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(
label: 'ٍStart', label: TranslationBase.of(context).start,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onTap: () { onTap: () {
print("chat=" + chat); print("chat=" + chat);
chat = chat =
"http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}";
launch(chat); launch(chat);
}, },
), ),

@ -45,21 +45,22 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#B61422'), color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).totalBalance, '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar,
color: Colors.white, color: Colors.white,
bold: true,
), ),
Texts( Texts(
'${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, TranslationBase.of(context).totalBalance,
color: Colors.white, color: Colors.white,
bold: true,
), ),
], ],
), ),

@ -150,7 +150,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.23, height: MediaQuery.of(context).size.height * 0.1,
color: Colors.grey[100], color: Colors.grey[100],
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -169,6 +169,7 @@ class PrescriptionItemsPage extends StatelessWidget {
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
), ),
), ),
if(false)
Container( Container(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(

@ -21,6 +21,8 @@ class MedicineSearch extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PharmacyViewModel>( return BaseView<PharmacyViewModel>(
allowAny: true,
onModelReady: (model) => model.clearMedicineSearch(),
builder: (BuildContext context, PharmacyViewModel model, Widget child) => builder: (BuildContext context, PharmacyViewModel model, Widget child) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,

@ -24,12 +24,14 @@ class PharmaciesList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PharmacyViewModel>( return BaseView<PharmacyViewModel>(
allowAny: true,
onModelReady: (model) => model.getPharmacies(id: medicineID), onModelReady: (model) => model.getPharmacies(id: medicineID),
builder: (BuildContext context, PharmacyViewModel model, Widget child) => builder: (BuildContext context, PharmacyViewModel model, Widget child) =>
AppScaffold( AppScaffold(
appBarTitle: TranslationBase.of(context).pharmaciesList, appBarTitle: TranslationBase.of(context).pharmaciesList,
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: Container( body: Container(
height: SizeConfig.screenHeight, height: SizeConfig.screenHeight,
child: ListView( child: ListView(

@ -27,7 +27,7 @@ class _SplashScreenState extends State<SplashScreen> {
Timer( Timer(
Duration(seconds: 1, milliseconds: 500), Duration(seconds: 1, milliseconds: 500),
() { () {
getUserData().then((value) { Provider.of<ProjectViewModel>(context, listen: false).loadSharedPrefLanguage().then((value) {
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => LandingPage(), builder: (BuildContext context) => LandingPage(),
@ -39,13 +39,7 @@ class _SplashScreenState extends State<SplashScreen> {
} }
Future getUserData() async { Future getUserData() async {
var data = await sharedPref.getObject(USER_PROFILE); Provider.of<ProjectViewModel>(context, listen: false).loadSharedPrefLanguage();
if (data != null) {
AuthenticatedUser userData = AuthenticatedUser.fromJson(data);
// Provider.of<ProjectViewModel>(context, listen: false).isLogin = true;
//authenticatedUserObject.isLogin = true;
//authenticatedUserObject.user = userData;
}
} }
@override @override

@ -1004,6 +1004,11 @@ class TranslationBase {
String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode];
String get dr => localizedValues['Dr'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode];
String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode];
String get instructions => localizedValues['instructions'][locale.languageCode];
String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode];
String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode];
String get start => localizedValues['start'][locale.languageCode];
String get infoChat => localizedValues['info-chat'][locale.languageCode];
String get noRecords => localizedValues['empty'][locale.languageCode]; String get noRecords => localizedValues['empty'][locale.languageCode];

@ -177,7 +177,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 100, height: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor,
), ),
), ),
), ),

@ -1,12 +1,16 @@
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class LabResultDetailsWidget extends StatefulWidget { class LabResultDetailsWidget extends StatefulWidget {
final List<LabResult> labResult; final List<LabOrderResult> labResult;
LabResultDetailsWidget({ LabResultDetailsWidget({
this.labResult, this.labResult,
@ -19,6 +23,7 @@ class LabResultDetailsWidget extends StatefulWidget {
class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> { class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent, color: Colors.transparent,
@ -36,7 +41,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(), children: fullData(projectViewModel),
), ),
], ],
), ),
@ -44,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
); );
} }
List<TableRow> fullData() { List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(
@ -52,7 +57,8 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -69,7 +75,8 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -79,6 +86,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
) )
])); ]));
widget.labResult.forEach((vital) { widget.labResult.forEach((vital) {
var date =DateUtil.convertStringToDate(vital.verifiedOnDateTime);
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(
child: Container( child: Container(
@ -86,7 +94,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${vital.verifiedOn}', '${projectViewModel.isArabic? DateUtil.getWeekDayArabic(date.weekday): DateUtil.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtil.getMonthArabic(date.month) : DateUtil.getMonth(date.month)} ${date.year}',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
@ -15,7 +16,7 @@ class LabResultChartAndDetails extends StatelessWidget {
@required this.name, @required this.name,
}) : super(key: key); }) : super(key: key);
final List<LabResult> labResult; final List<LabOrderResult> labResult;
final String name; final String name;
List<TimeSeriesSales> _timeSeriesData = []; List<TimeSeriesSales> _timeSeriesData = [];
@ -28,8 +29,8 @@ class LabResultChartAndDetails extends StatelessWidget {
headerWidget: AppTimeSeriesChart( headerWidget: AppTimeSeriesChart(
seriesList: generateData(), seriesList: generateData(),
chartName: name, chartName: name,
startDate: DateUtil.convertStringToDateTime(labResult[0].sampleCollectedOn), startDate: DateUtil.convertStringToDate(labResult[0].verifiedOnDateTime),
endDate: DateTime.now(), endDate: DateUtil.convertStringToDate(labResult[labResult.length-1].verifiedOnDateTime),
), ),
bodyWidget: LabResultDetailsWidget( bodyWidget: LabResultDetailsWidget(
labResult: labResult, labResult: labResult,
@ -49,7 +50,7 @@ class LabResultChartAndDetails extends StatelessWidget {
var resultValueInt = resultValueDouble.toInt(); var resultValueInt = resultValueDouble.toInt();
_timeSeriesData.add( _timeSeriesData.add(
TimeSeriesSales( TimeSeriesSales(
DateUtil.convertStringToDateTime(element.sampleCollectedOn), DateUtil.convertStringToDate(element.verifiedOnDateTime),
resultValueInt, resultValueInt,
), ),
); );

@ -38,14 +38,13 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
children: <Widget>[ children: <Widget>[
if (widget.url != null) if (widget.url != null)
Container( Container(
height: 39.0,
width: 39.0,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(7)), borderRadius: BorderRadius.all(Radius.circular(7)),
child: Image.memory( child: Image.memory(
dataFromBase64String(widget.url), dataFromBase64String(widget.url),
height: SizeConfig.imageSizeMultiplier * 11, height: SizeConfig.imageSizeMultiplier * 19,
width: SizeConfig.imageSizeMultiplier * 11, width: SizeConfig.imageSizeMultiplier * 18,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),

Loading…
Cancel
Save