From e679c7df0daca8f00dba7b9e3b0f895db777cf37 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Sep 2021 14:38:57 +0300 Subject: [PATCH] updates & fixes --- lib/core/service/er/er_service.dart | 17 +- .../service/medical/my_balance_service.dart | 2 +- .../medical/my_balance_view_model.dart | 2 +- lib/pages/Blood/confirm_payment_page.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 2 + .../covid-dirvethru-questions.dart | 1 + .../covid-drivethru-location.dart | 134 +++++--------- .../covid-payment-details.dart | 9 - .../covid-payment-summary.dart | 2 + .../ErService/EdOnline/DdServicesPage.dart | 64 +++---- lib/pages/ErService/NearestEr.dart | 164 +++++++++--------- lib/pages/ToDoList/ToDo.dart | 2 + lib/pages/livecare/widgets/clinic_card.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 2 +- .../medical/balance/confirm_payment_page.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 10 +- 16 files changed, 186 insertions(+), 235 deletions(-) diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart index bd3b6116..3e899f97 100644 --- a/lib/core/service/er/er_service.dart +++ b/lib/core/service/er/er_service.dart @@ -7,9 +7,6 @@ class ErService extends BaseService { List projectAvgERWaitingTimeModelList = List(); Map body = Map(); - String Latitude = ""; - String Longitude = ""; - String PhoneNumber = ""; Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { hasError = false; @@ -23,21 +20,15 @@ class ErService extends BaseService { body['Latitude'] = lat ?? 0; body['Longitude'] = long ?? 0; + dynamic localRes; + await baseAppClient.post(GET_NEAREST_HOSPITAL, onSuccess: (dynamic response, int statusCode) { - projectAvgERWaitingTimeModelList.clear(); - response['List_ProjectAvgERWaitingTime'].forEach((vital) { - projectAvgERWaitingTimeModelList - .add(ProjectAvgERWaitingTime.fromJson(vital)); - }); - projectAvgERWaitingTimeModelList.forEach((element) { - Latitude = '${element.latitude}'; - Longitude = '${element.longitude}'; - PhoneNumber = '${element.phoneNumber}'; - }); + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index e2744250..6fb91a37 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class MyBalanceService extends BaseService { List patientAdvanceBalanceAmountList = List(); - double totalAdvanceBalanceAmount; + dynamic totalAdvanceBalanceAmount; List patientInfoList = List(); GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index e33bc86c..ce9f35fa 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -38,7 +38,7 @@ class MyBalanceViewModel extends BaseViewModel { //=========================== - double get totalAdvanceBalanceAmount => + dynamic get totalAdvanceBalanceAmount => _myBalanceService.totalAdvanceBalanceAmount; String get updatedRegisterBloodMessage => diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index c384b7b5..f3f7bffb 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -218,7 +218,9 @@ class ConfirmPaymentPage extends StatelessWidget { authenticatedUser.patientID, authenticatedUser, browser, - false); + false, + null, + null); } onBrowserLoadStart(String url) { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 26a5b0fe..fb8b1ac9 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -640,6 +640,8 @@ class _BookSuccessState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index ed048b9f..0f07081f 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -152,6 +152,7 @@ class CovidDirveThruQuestionsState extends State { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); Navigator.push( context, FadePage( diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 3846c03b..4040abf5 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'covid-dirvethru-questions.dart'; @@ -34,15 +33,14 @@ class _CovidDrivethruLocationState extends State { String projectID = ""; List imagesInfo = List(); + DriveThroughTestingCenterModel selectedProject; + ProjectViewModel projectViewModel; @override void initState() { imagesInfo.add( - ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), ); WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin) { @@ -56,9 +54,7 @@ class _CovidDrivethruLocationState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - imagesInfo.add(ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -72,31 +68,17 @@ class _CovidDrivethruLocationState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).resultHeader, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 22.0, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).covidInfo, - style: TextStyle(fontSize: 16.0, color: Colors.black)), + child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 20.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.grey[700])), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])), ), Container( height: 60.0, @@ -112,18 +94,18 @@ class _CovidDrivethruLocationState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( - child: DropdownButton( + child: DropdownButton( hint: new Text(TranslationBase.of(context).selectAddress), - value: projectDropdownValue, - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.iD.toString(), + value: selectedProject, + items: projectsList.map((DriveThroughTestingCenterModel item) { + return new DropdownMenuItem( + value: item, child: new Text(item.projectName), ); }).toList(), onChanged: (newValue) { setState(() { - projectDropdownValue = newValue; + selectedProject = newValue; setProjectLocation(newValue); }); }, @@ -132,15 +114,8 @@ class _CovidDrivethruLocationState extends State { isLocationSelected ? Container( margin: EdgeInsets.only(top: 15.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)), ) : Container(), isLocationSelected @@ -149,16 +124,15 @@ class _CovidDrivethruLocationState extends State { decoration: BoxDecoration( border: Border.all(color: Colors.grey[400], width: 1.0), ), - child: Image.network( - "https://maps.googleapis.com/maps/api/staticmap?center=" + - this.projectLat + - "," + - this.projectLong + - "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + - this.projectLat + - "," + - this.projectLong + - "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), + child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" + + this.projectLat + + "," + + this.projectLong + + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + + this.projectLat + + "," + + this.projectLong + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), ) : SizedBox( height: MediaQuery.of(context).size.height * 0.35, @@ -184,8 +158,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { getDirections(); }, - child: Text(TranslationBase.of(context).getDirections, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -202,8 +175,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -213,8 +185,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { back(); }, - child: Text(TranslationBase.of(context).back, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -227,8 +198,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -238,8 +208,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { next(); }, - child: Text(TranslationBase.of(context).next, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -259,22 +228,17 @@ class _CovidDrivethruLocationState extends State { getDirections() { if (isLocationSelected) { - MapsLauncher.launchCoordinates(double.parse(projectLat), - double.parse(projectLong), this.projectName); + MapsLauncher.launchCoordinates(double.parse(projectLat), double.parse(projectLong), this.projectName); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to get directions"); + Utils.showErrorToast("Please select address from the dropdown menu to get directions"); } } next() { if (isLocationSelected) { - Navigator.push( - context, - FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,))); + Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList))); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to continue"); + Utils.showErrorToast("Please select address from the dropdown menu to continue"); } } @@ -282,34 +246,25 @@ class _CovidDrivethruLocationState extends State { Navigator.of(context).popAndPushNamed(HOME); } - setProjectLocation(newValue) { - print(newValue); + setProjectLocation(DriveThroughTestingCenterModel newValue) { setState(() { - this.projectLat = - projectsList[(int.parse(newValue) - 1)].latitude.toString(); - this.projectLong = - projectsList[(int.parse(newValue) - 1)].longitude.toString(); - this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; - this.projectID = - projectsList[(int.parse(newValue) - 1)].projectID.toString(); + this.projectLat = newValue.latitude.toString(); + this.projectLong = newValue.longitude.toString(); + this.projectName = newValue.projectName; + this.projectID = newValue.projectID.toString(); isLocationSelected = true; }); } getPaymentInfo(BuildContext context, String projectID) { CovidDriveThruService service = new CovidDriveThruService(); - CovidPaymentInfoResponse covidPaymentInfoResponse = - new CovidPaymentInfoResponse(); + CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service - .getCovidPaymentInformation( - context, int.parse(projectID), proceduresList[0].procedureID) - .then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - covidPaymentInfoResponse = - CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); Navigator.push( context, @@ -329,8 +284,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - CovidTestProceduresResponse covidTestProceduresResponse = - new CovidTestProceduresResponse(); + CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse(); service.getCovidTestProceduresList(context).then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 488dd3bf..67b973fe 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -30,7 +30,6 @@ class _CovidPaymentDetailsState extends State { @override void initState() { - print(widget.proceduresList[0].procedureName); widget.selectedProcedure = widget.proceduresList[0]; super.initState(); } @@ -336,14 +335,6 @@ class _CovidPaymentDetailsState extends State { widget.covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); - // Navigator.push( - // context, - // FadePage( - // page: CovidPaymentDetails( - // covidPaymentInfoResponse: covidPaymentInfoResponse, - // projectID: int.parse(projectID), - // proceduresList: proceduresList, - // ))); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index e71285b5..c3c70578 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -191,6 +191,8 @@ class _CovidPaymentSummaryState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index 7395b901..47f73c42 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -44,36 +45,39 @@ class _DdServicesPageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), - ), - title: Text( - 'ED Online', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), - // bold: true, - // color: Colors.white, - ), - leading: Builder( - builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - showConfirmMessage(context); - }, - ); - }, - ), - centerTitle: true, - ), + return AppScaffold( + appBarTitle: 'ED Online', + isShowDecPage: true, + isShowAppBar: true, + // appBarTitle: AppBar( + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Theme.of(context).textTheme.headline1.color, + // fontWeight: FontWeight.bold), + // ), + // title: Text( + // 'ED Online', + // style: TextStyle( + // fontWeight: FontWeight.bold, + // color: Theme.of(context).textTheme.headline1.color, + // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // // bold: true, + // // color: Colors.white, + // ), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Theme.of(context).textTheme.headline1.color, + // onPressed: () { + // showConfirmMessage(context); + // }, + // ); + // }, + // ), + // centerTitle: true, + // ), body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 0ecb19a7..57a3a8ae 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -1,16 +1,15 @@ -import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'widgets/card_position.dart'; -class NearestEr extends StatelessWidget { +class NearestEr extends StatefulWidget { static const String _url = "assets/images/"; int appointmentNo; @@ -18,92 +17,89 @@ class NearestEr extends StatelessWidget { NearestEr({this.appointmentNo, this.projectID}); + @override + _NearestErState createState() => _NearestErState(); +} + +class _NearestErState extends State { + List projectAvgERWaitingTimeModelList = List(); + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getERList()); + super.initState(); + } + @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemWidth = size.width / 2; - return BaseView( - onModelReady: appointmentNo != null && projectID != null - ? (model) => model.getProjectAvgERWaitingTimeOrders( - id: appointmentNo, projectID: projectID) - : (model) => model.getProjectAvgERWaitingTimeOrders(), - builder: (_, mode, widget) => AppScaffold( - isShowAppBar: true, - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).NearestEr, - baseViewModel: mode, - body: mode.ProjectAvgERWaitingTimeModeList.length > 0 - ? Container( - child: ListView( - children: [ - Text( - "${TranslationBase.of(context).NearestErDesc}", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - letterSpacing: 1.0, - fontWeight: FontWeight.w900, - color: new Color(0xFF60686b))), - Container( - margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), - child: GridView.count( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemWidth), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - controller: - new ScrollController(keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - children: List.generate(7, (index) { - return Container( - child: CardPosition( - waitingTime: mode - .ProjectAvgERWaitingTimeModeList[index] - .avgTimeInHHMM - .toString(), - text: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: '${mode.ProjectAvgERWaitingTimeModeList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', - type: mode - .ProjectAvgERWaitingTimeModeList[index].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[index] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName, - cardSize: itemWidth, - ), - ); - }), - ), + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).NearestEr, + body: projectAvgERWaitingTimeModelList.length > 0 + ? Container( + child: ListView( + children: [ + Text("${TranslationBase.of(context).NearestErDesc}", + textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemWidth), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: List.generate(7, (index) { + return Container( + child: CardPosition( + waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(), + text: projectAvgERWaitingTimeModelList[index].projectName.toString(), + image: 'assets/images/new-design/find_us_icon.png', + subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', + type: projectAvgERWaitingTimeModelList[index].iD.toString(), + telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(), + networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(), + latitude: projectAvgERWaitingTimeModelList[index].latitude, + longitude: projectAvgERWaitingTimeModelList[index].longitude, + projectname: projectAvgERWaitingTimeModelList[index].projectName, + cardSize: itemWidth, + ), + ); + }), ), - ], - ), - ) - : Center( - child: Texts('No Data'), + ), + ], ), - ), + ) + : Center( + child: Texts('No Data'), + ), ); } + + getERList() async { + GifLoaderDialogUtils.showMyDialog(context); + ErService service = new ErService(); + service.getProjectAvgERWaitingTimeOrders().then((response) { + if (response['MessageStatus'] == 1) { + setState(() { + projectAvgERWaitingTimeModelList.clear(); + response['List_ProjectAvgERWaitingTime'].forEach((vital) { + projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital)); + }); + }); + GifLoaderDialogUtils.hideDialog(context); + } else {} + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index febbdf0f..6e9d6bce 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -774,6 +774,8 @@ class _ToDoState extends State { authenticatedUser, widget.browser, appo.isLiveCareAppointment, + null, + null, appo.appointmentDate, appo.appointmentNo, appo.clinicID, diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 7276b961..6a7573d7 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -39,7 +39,7 @@ class _State extends State { children: [ Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), - color: widget.isSelected ? Colors.blue : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, + color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 3bf83ac0..94bce343 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -256,7 +256,7 @@ class _clinic_listState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString()); } onBrowserLoadStart(String url) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index eecb6abd..0d2fac93 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -226,7 +226,9 @@ class ConfirmPaymentPage extends StatelessWidget { advanceModel.fileNumber, authenticatedUser, browser, - false); + false, + null, + null); } onBrowserLoadStart(String url) { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e66b2eae..b4aed910 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -168,6 +168,8 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, @@ -186,6 +188,8 @@ class MyInAppBrowser extends InAppBrowser { patientID, authenticatedUser, isLiveCareAppo, + servID, + LiveServID, appoDate, appoNo, clinicID, @@ -233,13 +237,13 @@ class MyInAppBrowser extends InAppBrowser { dynamic patientID, AuthenticatedUser authUser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, - var patientData, - var servID, - var LiveServID]) async { + var patientData]) async { getDeviceToken(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm();