From 5b47aaac6f2632e456194733d2b3c3327c656e2c Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Thu, 30 Sep 2021 11:42:09 +0300 Subject: [PATCH] icon and find us distance --- .../ContactUs/findus/hospitrals_page.dart | 32 +- .../ContactUs/findus/pharmacies_page.dart | 14 +- .../covid-drivethru-location.dart | 318 ++++++++++-------- .../fragments/home_page_fragment2.dart | 6 +- .../prescription_items_page.dart | 272 ++++++++------- .../prescriptions_history_page.dart | 14 +- lib/uitl/utils.dart | 228 +------------ 7 files changed, 366 insertions(+), 518 deletions(-) diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 41dcdf58..c0d99df2 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -86,14 +86,30 @@ class _HospitalsPageState extends State { Expanded( child: Padding( padding: EdgeInsets.only(left: 12, right: 12), - child: Text( - _location.locationName?.trim() ?? "", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - letterSpacing: -0.56, - ), + child: Column( + children: [ + Text( + _location.locationName?.trim() ?? "", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), + + Text( + TranslationBase.of(context).km+" "+ _location.distanceInKilometers.toString() ?? "", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), + ], + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, ), ), ), //model.cOCItemList[index].cOCTitl diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index 58460e9c..a5fb6223 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -105,7 +105,7 @@ class _PharmaciesPageState extends State { ), ), SizedBox( - height: 4, + height: 2, ), Text( _location.cityName?.trim() ?? "", @@ -116,6 +116,18 @@ class _PharmaciesPageState extends State { letterSpacing: -0.56, ), ), + SizedBox( + height: 2, + ), + Text( + TranslationBase.of(context).km+" "+ _location.distanceInKilometers.toString() ?? "", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), ], ), ), diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 4040abf5..8f38290e 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -6,12 +6,15 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; @@ -34,6 +37,7 @@ class _CovidDrivethruLocationState extends State { List imagesInfo = List(); DriveThroughTestingCenterModel selectedProject; + final GlobalKey locationDropdownKey = GlobalKey(); ProjectViewModel projectViewModel; @@ -61,167 +65,187 @@ class _CovidDrivethruLocationState extends State { imagesInfo: imagesInfo, description: TranslationBase.of(context).covidInfo, isShowDecPage: true, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), - child: Column( - 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)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - 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])), - ), - Container( - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey[400], - width: 1.0, - ), - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.all(8.0), - width: MediaQuery.of(context).size.width, - margin: EdgeInsets.only(top: 15.0), - child: DropdownButtonHideUnderline( - child: DropdownButton( - hint: new Text(TranslationBase.of(context).selectAddress), - value: selectedProject, - items: projectsList.map((DriveThroughTestingCenterModel item) { - return new DropdownMenuItem( - value: item, - child: new Text(item.projectName), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - selectedProject = newValue; - setProjectLocation(newValue); - }); - }, - ), - )), - 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)), - ) - : Container(), - isLocationSelected - ? Container( - margin: EdgeInsets.only(top: 5.0), - 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"), - ) - : SizedBox( - height: MediaQuery.of(context).size.height * 0.35, - ), - Container( - height: MediaQuery.of(context).size.height * 0.15, - width: double.infinity, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( child: Column( + mainAxisSize: MainAxisSize.max, children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.91, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.red[300], - onPressed: () { - getDirections(); - }, - child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)), - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.grey[500], - onPressed: () { - back(); - }, - child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)), - ), - ), - ), + Padding( + padding: const EdgeInsets.only(left: 14, right: 14), + child: Column( + children: [ + Container( + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, color: Colors.black, letterSpacing: -1.14)), + ), + Container( + margin: EdgeInsets.only(top: 6.0), + child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)), ), - Expanded( - flex: 1, + InkWell( + onTap: () { + // dropdownKey.currentState; + // openDropdown(clinicDropdownKey); + }, child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.grey[500], - onPressed: () { - next(); - }, - child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), - ), + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(top: 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + onTap: () { + print("Clicked"); + }, + key: locationDropdownKey, + hint: new Text( + TranslationBase.of(context).selectAddress, + ), + value: selectedProject, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + items: projectsList.map((DriveThroughTestingCenterModel item) { + return new DropdownMenuItem( + value: item, + child: new Text(item.projectName), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + selectedProject = newValue; + setProjectLocation(newValue); + }); + }, + ), + ), + ), + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], ), ), ), ], ), ), + mHeight(20), + isLocationSelected + ? Stack( + children: [ + Container( + margin: EdgeInsets.only(top: 5.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"), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + InkWell( + onTap: () { + getDirections(); + }, + child: Card( + shape: cardRadius(1000), + elevation: 4, + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6), + child: Row( + children: [ + SvgPicture.asset( + "assets/images/new/blood_pressure.svg", + width: 18, + height: 18, + ), + mWidth(6), + Text( + TranslationBase.of(context).getDirections, + style: TextStyle( + color: Colors.black, + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ) + ], + ), + ), + ), + ), + ], + ), + ], + ) + : SizedBox( + height: MediaQuery.of(context).size.height * 0.35, + ), + mHeight(12), ], ), ), - ], + ), ), - ), + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: CustomColors.accentColor, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: CustomColors.accentColor, + onPressed: () { + next(); + }, + child: Text( + TranslationBase.of(context).next, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + ), + )), + ], ), ); } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index f9a8ebf7..b56ea43f 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -153,7 +153,7 @@ class _HomePageFragment2State extends State { width: double.infinity, height: MediaQuery.of(context).size.width * 0.26, child: ListView.separated( - itemCount: 4, + itemCount: 5, padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), @@ -163,13 +163,13 @@ class _HomePageFragment2State extends State { child: myMedicalList[index], width: MediaQuery.of(context).size.width * 0.26, height: MediaQuery.of(context).size.width * 0.26, - margin: EdgeInsets.only(left: index == 3 ? 20 : 0, right: index == 0 ? 20 : 0), + margin: EdgeInsets.only(left: index == 4 ? 20 : 0, right: index == 0 ? 20 : 0), ) : Container( child: myMedicalList[index], width: MediaQuery.of(context).size.width * 0.26, height: MediaQuery.of(context).size.width * 0.26, - margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == 3 ? 20 : 0), + margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == 4 ? 20 : 0), ); }, separatorBuilder: (BuildContext context, int index) { diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index e531558a..816a6a06 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -84,98 +84,105 @@ class PrescriptionItemsPage extends StatelessWidget { margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4), shape: cardRadius(12), child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + padding: EdgeInsets.only(top: 12, bottom: 20, left:projectViewModel.isArabic? 12:20, right: projectViewModel.isArabic? 20:12), + child: Row( children: [ - Text( - model.prescriptionReportListINP[index].itemDescription.isNotEmpty - ? model.prescriptionReportListINP[index].itemDescription - : model.prescriptionReportListINP[index].itemDescriptionN ?? '', - style: TextStyle( - fontSize: 16, - letterSpacing: -0.64, - fontWeight: FontWeight.w600, - ), - ), - mHeight(10), - Row( - children: [ - Container( - child: Card( - child: Image.network( - model.prescriptionReportListINP[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 60, + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.prescriptionReportListINP[index].itemDescription.isNotEmpty + ? model.prescriptionReportListINP[index].itemDescription + : model.prescriptionReportListINP[index].itemDescriptionN ?? '', + style: TextStyle( + fontSize: 16, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, ), - margin: EdgeInsets.zero, - clipBehavior: Clip.antiAlias, - shape: cardRadius(2000), ), - clipBehavior: Clip.antiAlias, - decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1), - ), - mWidth(12), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - TranslationBase.of(context).route + ": ", - style: TextStyle( - color: Colors.grey, - fontSize: 10, - letterSpacing: -0.4, - fontWeight: FontWeight.w600, + mHeight(10), + Row( + children: [ + Container( + child: Card( + child: Image.network( + model.prescriptionReportListINP[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 60, ), + margin: EdgeInsets.zero, + clipBehavior: Clip.antiAlias, + shape: cardRadius(2000), ), - Text( - model.prescriptionReportListINP[index].route, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, + clipBehavior: Clip.antiAlias, + decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1), + ), + mWidth(12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + TranslationBase.of(context).route + ": ", + style: TextStyle( + color: Colors.grey, + fontSize: 10, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + ), + ), + Text( + model.prescriptionReportListINP[index].route, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], ), - ), - ], - ), - Row( - children: [ - Text( - TranslationBase.of(context).dailyDoses + ": ", - style: TextStyle( - color: Colors.grey, - fontSize: 10, - letterSpacing: -0.4, - fontWeight: FontWeight.w600, + Row( + children: [ + Text( + TranslationBase.of(context).dailyDoses + ": ", + style: TextStyle( + color: Colors.grey, + fontSize: 10, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + ), + ), + Text( + model.prescriptionReportListINP[index].doseDailyQuantity.toString(), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], ), - ), - Text( - model.prescriptionReportListINP[index].doseDailyQuantity.toString(), - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, + mHeight(12), + Text( + model.prescriptionReportListINP[index].remarks, + style: TextStyle( + color: Colors.grey, + fontSize: 10, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + ), ), - ), - ], - ), - mHeight(12), - Text( - model.prescriptionReportListINP[index].remarks, - style: TextStyle( - color: Colors.grey, - fontSize: 10, - letterSpacing: -0.4, - fontWeight: FontWeight.w600, - ), - ), - ], - ) - ], + ], + ) + ], + ), + ], + ), ), + Icon(Icons.arrow_forward_ios,size: 16,), ], ), ), @@ -231,61 +238,68 @@ class PrescriptionItemsPage extends StatelessWidget { ], ), child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + padding: EdgeInsets.only(top: 12, bottom: 20, left:projectViewModel.isArabic? 12:20, right: projectViewModel.isArabic? 20:12), + child: Row( children: [ - Text( - (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty - ? model.prescriptionReportEnhList[index].itemDescription - : model.prescriptionReportEnhList[index].itemDescriptionN ?? '') - .toLowerCase() - .capitalizeFirstofEach, - style: TextStyle( - fontSize: 16, - color: Color(0xff2E303A), - letterSpacing: -0.64, - fontWeight: FontWeight.w600, - ), - ), - mHeight(10), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Card( - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 48, - height: 48, + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty + ? model.prescriptionReportEnhList[index].itemDescription + : model.prescriptionReportEnhList[index].itemDescriptionN ?? '') + .toLowerCase() + .capitalizeFirstofEach, + style: TextStyle( + fontSize: 16, + color: Color(0xff2E303A), + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), ), - margin: EdgeInsets.zero, - clipBehavior: Clip.antiAlias, - shape: cardRadius(2000), - ), - mWidth(12), - Expanded( - child: Column( + mHeight(10), + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - myRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic), - myRichText( - TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), projectViewModel.isArabic), - mHeight(9), - Text( - model.prescriptionReportEnhList[index].remarks, - style: TextStyle( - color: Color(0xff575757), - fontSize: 12, - letterSpacing: -0.4, - fontWeight: FontWeight.w600, + Card( + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 48, + height: 48, ), + margin: EdgeInsets.zero, + clipBehavior: Clip.antiAlias, + shape: cardRadius(2000), ), + mWidth(12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + myRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic), + myRichText( + TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), projectViewModel.isArabic), + mHeight(9), + Text( + model.prescriptionReportEnhList[index].remarks, + style: TextStyle( + color: Color(0xff575757), + fontSize: 12, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ) ], ), - ) - ], + ], + ), ), + Icon(Icons.arrow_forward_ios,size: 16,), ], ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index 3ce724bf..d3e0e615 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.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'; @@ -77,14 +78,17 @@ class PrescriptionsHistoryPage extends StatelessWidget { decoration: BoxDecoration( color: _color, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - bottomLeft: Radius.circular(10.0), + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + bottomLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight:projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + bottomRight:projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + ), ), ), Expanded( child: Padding( - padding: EdgeInsets.only(left: 12, right: 12), + padding: EdgeInsets.only(left: projectViewModel.isArabic?6:12, right: projectViewModel.isArabic?12:6), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, @@ -122,7 +126,9 @@ class PrescriptionsHistoryPage extends StatelessWidget { ], ), ), - ) + ), + Icon(Icons.arrow_forward_ios,size: 16,), + mWidth(6), ], ), )); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 4cc1745b..957adf6e 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -572,19 +572,6 @@ class Utils { ), )); - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(6) - ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) - : null, - child: - MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), - )); - medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( @@ -595,31 +582,6 @@ class Utils { ), )); - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(25) - ? Navigator.push( - context, - FadePage(page: VitalSignDetailsScreen()), - ) - : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).vitalSigns, - imagePath: 'vital_signs.png', - subTitle: TranslationBase.of(context).vitalSignsSubtitle, - isEnable: projectViewModel.havePrivilege(25), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, - imagePath: 'active_medications.png', - subTitle: TranslationBase.of(context).myMedicalSubtitle, - isEnable: false, - ), - )); - medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(6) ? Navigator.push( @@ -629,196 +591,10 @@ class Utils { ), ) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myInvoice, - imagePath: 'Invoice.png', - subTitle: TranslationBase.of(context).invoicesList, - isEnable: projectViewModel.havePrivilege(14), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).eye, - imagePath: 'eye_measurement_icon.png', - subTitle: TranslationBase.of(context).eyeSubtitle, - isEnable: projectViewModel.havePrivilege(14), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).insuranceSubtitle, - isEnable: projectViewModel.havePrivilege(22), - ), - )); - - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).updateInsurance, - imagePath: 'insurance_update_icon_.png', - subTitle: TranslationBase.of(context).updateInsuranceSubtitle, - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).insuranceApproval, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, - isEnable: projectViewModel.havePrivilege(18), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).allergies, - imagePath: 'my_allergies_icon.png', - subTitle: TranslationBase.of(context).allergiesSubtitle, - isEnable: projectViewModel.havePrivilege(23), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myVaccines, - imagePath: 'my_vaccines_icon.png', - subTitle: TranslationBase.of(context).myVaccinesSubtitle, - isEnable: projectViewModel.havePrivilege(26), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).medical, - imagePath: 'medical_reports_icon.png', - subTitle: TranslationBase.of(context).medicalSubtitle, - isEnable: projectViewModel.havePrivilege(20), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'monthly_reports_icon.png', - subTitle: TranslationBase.of(context).monthlySubtitle, - isEnable: projectViewModel.havePrivilege(19), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).sick, - imagePath: 'sick_leaves_icons.png', - subTitle: TranslationBase.of(context).sickSubtitle, - isEnable: projectViewModel.havePrivilege(16), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myBalance, - imagePath: 'check-in.png', - subTitle: TranslationBase.of(context).myBalanceSubtitle, - isEnable: projectViewModel.havePrivilege(47), - ), - )); - - // TODO mosa check it - medical.add(MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - isEnable: projectViewModel.havePrivilege(61), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).myTrackers, - imagePath: 'my_tracker_icon.png', - subTitle: TranslationBase.of(context).myTrackersSubtitle, - isEnable: projectViewModel.havePrivilege(24), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).smartWatches, - imagePath: 'smartwatch_icon.png', - subTitle: TranslationBase.of(context).smartWatchesSubtitle, - isEnable: projectViewModel.havePrivilege(30), - ), - )); - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, imagePath: 'ask_doctor_icon.png', subTitle: TranslationBase.of(context).askYourSubtitle, isEnable: projectViewModel.havePrivilege(28)), + child: + MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); - if (projectViewModel.havePrivilege(32) || true) { - medical.add(InkWell( - onTap: () { - if (projectViewModel.isLogin) { - userData().then((userData_) { - String patientID = userData_.patientID.toString(); - GifLoaderDialogUtils.showMyDialog(context); - projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); - }); - } else { - Navigator.push( - context, - FadePage( - page: NotAutPage( - title: TranslationBase.of(context).autoWifi, - description: TranslationBase.of(context).infoAutoWifi, - infoList: [], - imagesInfo: [ - ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/ar/0.png'), - ], - ))); - } - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).internet, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).internetSubtitle, - ), - )); - } - - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).chatbot, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).chatbotSubtitle, - isEnable: projectViewModel.havePrivilege(40), - ), - )); return medical; }