From f3d7686a10b339764695b4c73bc5a38ed4a0c6ba Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 1 Sep 2021 17:19:35 +0300 Subject: [PATCH 1/2] improvement. --- lib/pages/ContactUs/contact_us_page.dart | 2 +- .../ContactUs/widgets/card_common_contat.dart | 79 +++++++++++++++++-- 2 files changed, 75 insertions(+), 6 deletions(-) diff --git a/lib/pages/ContactUs/contact_us_page.dart b/lib/pages/ContactUs/contact_us_page.dart index 8bb19b4c..cbd95e9b 100644 --- a/lib/pages/ContactUs/contact_us_page.dart +++ b/lib/pages/ContactUs/contact_us_page.dart @@ -35,7 +35,7 @@ class _ContactUsPageState extends State { body: GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(top: 25), + padding: EdgeInsets.all(21), shrinkWrap: true, children: [ CardCommonContact( diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index 0fde26cd..31f09101 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -26,11 +26,80 @@ class CardCommonContact extends StatelessWidget { }, child: - // MedicalProfileItem( - // imagePath: image, - // title: text, - // subTitle: subText, - // isPngImage: true, + // Container( + // // height: double.infinity, + // // width: double.infinity, + // // margin: EdgeInsets.all(0), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(10.0), + // ), + // boxShadow: [ + // BoxShadow( + // color: Color(0xff000000).withOpacity(.05), + // //spreadRadius: 5, + // blurRadius: 27, + // offset: Offset(0, -3), + // ), + // ], + // color: Colors.white), + // clipBehavior: Clip.antiAlias, + // child: Stack( + // children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // // Align( + // // alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, + // // child: Image.asset( + // // "assets/images/medical/$imagePath", + // // height: SizeConfig.heightMultiplier * 5, + // // width: SizeConfig.heightMultiplier * 5, + // // ), + // // ), + // Image.asset( + // image, + // // height: SizeConfig.widthMultiplier * 7, + // // width: SizeConfig.widthMultiplier * 7, + // // color: imgColor, + // ), + // + // Text( + // text, + // maxLines: 1, + // style: TextStyle( + // // fontSize: SizeConfig.textMultiplier * 1.4, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.3, + // height: 13 / 10, + // ), + // ), + // Container( + // width: double.infinity, + // child: Row( + // children: [ + // Expanded( + // child: Text( + // subText, + // maxLines: 1, + // style: TextStyle( + // // fontSize: SizeConfig.textMultiplier * 1.4, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.3, + // height: 1, + // ), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // ], + // ), // ) Container( From 62ca00940461269f51257e164b78f11cb665697c Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 2 Sep 2021 17:00:50 +0300 Subject: [PATCH 2/2] improvement. --- lib/config/config.dart | 4 +- lib/pages/BookAppointment/QRCode.dart | 104 ++------- .../BookAppointment/widgets/DoctorView.dart | 10 +- .../ContactUs/widgets/card_common_contat.dart | 114 ++------- lib/pages/ErService/ErOptions.dart | 217 +++++++++++------- lib/pages/ErService/widgets/card_common.dart | 86 +++---- .../MyAppointments/AppointmentDetails.dart | 186 +++++---------- .../medical/ask_doctor/ask_doctor_page.dart | 19 +- .../medical/ask_doctor/request_type.dart | 23 +- .../prescription_items_page.dart | 2 +- lib/widgets/new_design/doctor_header.dart | 164 ++++++------- 11 files changed, 377 insertions(+), 552 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8b37bc66..5af95569 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index ff7224be..97cda171 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -83,15 +83,11 @@ class _QRCodeState extends State { border: Border.all(color: Colors.black), borderRadius: BorderRadius.circular(10), ), - child: Image.asset( - "assets/images/nfc/ic_nfc.png"), + child: Image.asset("assets/images/nfc/ic_nfc.png"), ), onTap: () { - showNfcReader(context, - onNcfScan: (String nfcId) { - Future.delayed( - const Duration(milliseconds: 100), - () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { sendNfcCheckInRequest(nfcId); }); }); @@ -125,23 +121,14 @@ class _QRCodeState extends State { child: Row( children: [ Container( - margin: - EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), - child: Image.asset( - "assets/images/new-design/device_icon.png", - width: MediaQuery.of(context).size.width / 3.4, - height: MediaQuery.of(context).size.width / 3.4), + margin: EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), + child: Image.asset("assets/images/new-design/device_icon.png", width: MediaQuery.of(context).size.width / 3.4, height: MediaQuery.of(context).size.width / 3.4), ), Expanded( child: Container( width: double.infinity, - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, - style: TextStyle( - color: Colors.red[700], - fontSize: 18.0, - fontWeight: FontWeight.bold)), + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)), ), ), ], @@ -155,13 +142,8 @@ class _QRCodeState extends State { ), ), Container( - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).appoInfo, - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700], - fontWeight: FontWeight.bold)), + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(left: 20.0, bottom: 20.0), @@ -176,37 +158,20 @@ class _QRCodeState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.doctorNameObj, - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700], - fontWeight: FontWeight.bold)), + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), ), Container( - margin: EdgeInsets.only( - bottom: 10.0, left: 20.0, right: 20.0), - child: Text( - getDoctorSpeciality( - widget.patientShareResponse.doctorSpeciality), - style: TextStyle( - fontSize: 18.0, color: Colors.grey[700])), + margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0), + child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), ), Container( - margin: EdgeInsets.only( - top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.projectName, - style: TextStyle( - fontSize: 18.0, color: Colors.grey[700])), + margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), ), Container( - margin: EdgeInsets.only( - top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text( - getDate(widget.patientShareResponse.appointmentDate), - style: TextStyle( - fontSize: 18.0, color: Colors.grey[700])), + margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), ), ], ), @@ -233,9 +198,7 @@ class _QRCodeState extends State { // getAppoQR(context); sendEmail(); }, - child: Text( - TranslationBase.of(context).sendEmail.toUpperCase(), - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).sendEmail.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), ), ], @@ -262,9 +225,7 @@ class _QRCodeState extends State { onPressed: () { navigateToHome(context); }, - child: Text( - TranslationBase.of(context).close.toUpperCase(), - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).close.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), ), ], @@ -281,8 +242,7 @@ class _QRCodeState extends State { DoctorsListService service = new DoctorsListService(); if (await widget.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await widget.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await widget.sharedPref.getObject(USER_PROFILE)); setState(() { widget.authUser = data; }); @@ -290,24 +250,14 @@ class _QRCodeState extends State { ConfirmDialog dialog = new ConfirmDialog( context: context, - confirmMessage: "Send a copy of this QR to the email " + - widget.authUser.emailAddress + - "?", + confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?", okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () { GifLoaderDialogUtils.showMyDialog(context); service - .sendAppointmentQREmail( - widget.authUser.emailAddress, - widget.patientShareResponse.appointmentDate, - widget.patientShareResponse.appointmentNo.toString(), - widget.patientShareResponse.doctorNameObj, - widget.patientShareResponse.projectName, - widget.appoQR, - getDoctorSpeciality( - widget.patientShareResponse.doctorSpeciality), - context) + .sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(), + widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context) .then((res) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); @@ -326,8 +276,7 @@ class _QRCodeState extends State { Navigator.of(context).pushNamed(HOME); } - getPatientShare(context, String appointmentNo, int clinicID, int projectID, - DoctorList docObject) {} + getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {} String getDate(String appoDate) { var appoDateFormatted = ""; @@ -367,10 +316,7 @@ class _QRCodeState extends State { DoctorsListService service = new DoctorsListService(); - service - .sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, - widget.patientShareResponse.projectID, context) - .then((res) { + service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 769231cd..faf8be9e 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -17,15 +17,17 @@ class DoctorView extends StatelessWidget { final DoctorList doctor; bool isLiveCareAppointment; bool isShowFlag; + final VoidCallback onTap; - DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true}); + DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap}); @override Widget build(BuildContext context) { return InkWell( - onTap: () { - if (isShowFlag) getDoctorsProfile(context, doctor,isAppo: true); - }, + onTap: onTap ?? + () { + if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true); + }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index 31f09101..fb8fe6b6 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -24,108 +24,24 @@ class CardCommonContact extends StatelessWidget { onTap: () { navigateToSearch(context, this.type); }, - child: - - // Container( - // // height: double.infinity, - // // width: double.infinity, - // // margin: EdgeInsets.all(0), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(10.0), - // ), - // boxShadow: [ - // BoxShadow( - // color: Color(0xff000000).withOpacity(.05), - // //spreadRadius: 5, - // blurRadius: 27, - // offset: Offset(0, -3), - // ), - // ], - // color: Colors.white), - // clipBehavior: Clip.antiAlias, - // child: Stack( - // children: [ - // Padding( - // padding: EdgeInsets.all(10), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // // Align( - // // alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, - // // child: Image.asset( - // // "assets/images/medical/$imagePath", - // // height: SizeConfig.heightMultiplier * 5, - // // width: SizeConfig.heightMultiplier * 5, - // // ), - // // ), - // Image.asset( - // image, - // // height: SizeConfig.widthMultiplier * 7, - // // width: SizeConfig.widthMultiplier * 7, - // // color: imgColor, - // ), - // - // Text( - // text, - // maxLines: 1, - // style: TextStyle( - // // fontSize: SizeConfig.textMultiplier * 1.4, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.3, - // height: 13 / 10, - // ), - // ), - // Container( - // width: double.infinity, - // child: Row( - // children: [ - // Expanded( - // child: Text( - // subText, - // maxLines: 1, - // style: TextStyle( - // // fontSize: SizeConfig.textMultiplier * 1.4, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.3, - // height: 1, - // ), - // ), - // ), - // ], - // ), - // ), - // ], - // ), - // ), - // ], - // ), - // ) - - Container( - margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), - decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Container( + padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Texts(this.text, - // overflow: TextOverflow.clip, - color: secondaryColor, - fontWeight: FontWeight.w700, - fontSize: 20.0), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Texts(this.subText, color: Colors.black, fontSize: 15.0), - ), - Align( - alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 8.0), - child: Image.asset(this.image, width: 60.0, height: 60.0), - ), + Image.asset(this.image, width: 42.0, height: 42.0), + Text( + text + "${subText.isEmpty ? "" : "\n$subText"}", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), ), ], ), diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index af6f0638..6cc61195 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -21,7 +21,6 @@ class ErOptions extends StatefulWidget { const ErOptions({Key key, this.isAppbar}) : super(key: key); - @override _ErOptionsState createState() => _ErOptionsState(); } @@ -32,13 +31,12 @@ class _ErOptionsState extends State { @override void initState() { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); super.initState(); } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -48,90 +46,133 @@ class _ErOptionsState extends State { isShowAppBar: widget.isAppbar, appBarTitle: TranslationBase.of(context).bookAppo, isShowDecPage: false, - body: Container( - margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - Container( - height: 170, - margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: CardCommonEr( - image: 'assets/images/new-design/AM.PNG', - text: TranslationBase.of(context).ambulancerequest, - subText: TranslationBase.of(context).requestA, - onTap: (){ - Navigator.push( - context, - FadePage( - page: AmbulanceReq())); - }, - - ), - ), - Expanded( - child: CardCommonEr( - image: 'assets/images/new-design/emergency_icon.png', - text: TranslationBase.of(context).nearester, - subText: TranslationBase.of(context).locationa, - onTap:(){ - Navigator.push( - context, - FadePage( - page: NearestEr())); - }), - - ) - ], - ), - ), - Container( - margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - height: 170, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: CardCommonEr( - image: 'assets/images/new-design/AM.PNG', - text:'ED service', - subText: 'ED service', - onTap: (){ - Navigator.push( - context, - FadePage(page: DdServicesPage()) - ); - }, - - ), - ), - Expanded( - child: CardCommonEr( - locked: rrtLocked, - image: 'assets/images/new-design/AM.PNG', - text: TranslationBase.of(context).rrtService, - subText: TranslationBase.of(context).rapidResponseTeam, - onTap:(){ - Navigator.push( - context, - FadePage( - page: RRTMainScreen())); - }), - ) - ], - ), - ), - ], - ), + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), + body: GridView( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.all(21), + shrinkWrap: true, + children: [ + CardCommonEr( + image: 'assets/images/new-design/AM.PNG', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + onTap: () { + Navigator.push(context, FadePage(page: AmbulanceReq())); + }, + ), + CardCommonEr( + image: 'assets/images/new-design/emergency_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + onTap: () { + Navigator.push(context, FadePage(page: NearestEr())); + }), + CardCommonEr( + image: 'assets/images/new-design/AM.PNG', + text: 'ED service', + subText: 'ED service', + onTap: () { + Navigator.push(context, FadePage(page: DdServicesPage())); + }, + ), + CardCommonEr( + locked: rrtLocked, + image: 'assets/images/new-design/AM.PNG', + text: TranslationBase.of(context).rrtService, + subText: TranslationBase.of(context).rapidResponseTeam, + onTap: () { + Navigator.push(context, FadePage(page: RRTMainScreen())); + }), + ], ), + + // + // body: Container( + // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // + // Container( + // height: 170, + // margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Expanded( + // child: CardCommonEr( + // image: 'assets/images/new-design/AM.PNG', + // text: TranslationBase.of(context).ambulancerequest, + // subText: TranslationBase.of(context).requestA, + // onTap: (){ + // Navigator.push( + // context, + // FadePage( + // page: AmbulanceReq())); + // }, + // + // ), + // ), + // Expanded( + // child: CardCommonEr( + // image: 'assets/images/new-design/emergency_icon.png', + // text: TranslationBase.of(context).nearester, + // subText: TranslationBase.of(context).locationa, + // onTap:(){ + // Navigator.push( + // context, + // FadePage( + // page: NearestEr())); + // }), + // + // ) + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + // height: 170, + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Expanded( + // child: CardCommonEr( + // image: 'assets/images/new-design/AM.PNG', + // text:'ED service', + // subText: 'ED service', + // onTap: (){ + // Navigator.push( + // context, + // FadePage(page: DdServicesPage()) + // ); + // }, + // + // ), + // ), + // Expanded( + // child: CardCommonEr( + // locked: rrtLocked, + // image: 'assets/images/new-design/AM.PNG', + // text: TranslationBase.of(context).rrtService, + // subText: TranslationBase.of(context).rapidResponseTeam, + // onTap:(){ + // Navigator.push( + // context, + // FadePage( + // page: RRTMainScreen())); + // }), + // ) + // ], + // ), + // ), + // ], + // ), + // ), ); } } - diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index cd0dfaa9..409fdf21 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -1,11 +1,5 @@ -//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import '../AmbulanceReq.dart'; -import '../NearestEr.dart'; - class CardCommonEr extends StatelessWidget { final image; final text; @@ -13,14 +7,13 @@ class CardCommonEr extends StatelessWidget { final bool locked; final Function onTap; - const CardCommonEr( - { - this.locked = false, - @required this.image, - @required this.text, - @required this.subText, - @required this.onTap, - }); + const CardCommonEr({ + this.locked = false, + @required this.image, + @required this.text, + @required this.subText, + @required this.onTap, + }); @override Widget build(BuildContext context) { @@ -31,51 +24,38 @@ class CardCommonEr extends StatelessWidget { child: Stack( children: [ Container( - margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), - decoration: BoxDecoration(boxShadow: [ - BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) - ], borderRadius: BorderRadius.circular(10), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Text(this.text, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFFc5272d), - letterSpacing: 1.0, - fontSize: 20.0)), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Text(this.subText, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), - ), - Spacer(), - Container( - alignment: Alignment.bottomRight, - margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), - child: Image.asset(this.image, width: 60.0, height: 60.0), + width: double.infinity, + padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), - ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset(this.image, width: 42.0, height: 42.0), + Text( + text + "${subText.isEmpty ? "" : "\n$subText"}", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + ), + ], + ), ), - ), - if(locked) - Align( - alignment: Alignment.center, - child: lock() - ) - ] , + if (locked) Align(alignment: Alignment.center, child: lock()) + ], ), ), ); } - Widget lock(){ - return Container(child: Icon(Icons.lock_rounded, size: 80),); + Widget lock() { + return Container( + child: Icon(Icons.lock_rounded, size: 80), + ); } - } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 46b1fb40..ec658c67 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -89,135 +89,67 @@ class _AppointmentDetailsState extends State with SingleTick child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Container( - // margin: EdgeInsets.only(top: 20.0), - // alignment: Alignment.center, - // child: ClipRRect( - // borderRadius: BorderRadius.circular(100.0), - // child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0), - // ), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - // alignment: Alignment.center, - // child: - // Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0), - // alignment: Alignment.center, - // child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle(fontSize: 12.0, color: Colors.grey[900], letterSpacing: 1.0)), - // ), - // Container( - // margin: EdgeInsets.only(top: 5.0), - // alignment: Alignment.center, - // child: RatingBar.readOnly( - // initialRating: widget.appo.actualDoctorRate.toDouble(), - // size: 35.0, - // filledColor: Colors.yellow[700], - // emptyColor: Colors.grey[500], - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: Icons.star, - // ), - // ), - // InkWell( - // onTap: () { - // getDoctorRatingsDetails(); - // }, - // child: Container( - // margin: EdgeInsets.only(top: 5.0), - // alignment: Alignment.center, - // child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")", - // style: TextStyle( - // fontSize: 14.0, - // color: Colors.blue[800], - // letterSpacing: 1.0, - // decoration: TextDecoration.underline, - // )), - // ), - // ), - // Container( - // alignment: Alignment.center, - // child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")), - // ), - // Container( - // alignment: Alignment.center, - // child: Text(widget.appo.startTime.substring(0, 5)), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0), - // child: Divider( - // color: Colors.grey[500], - // ), - // ), - DoctorHeader( - headerModel: HeaderModel( - widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, - widget.appo.doctorImageURL, - widget.appo.doctorSpeciality, - "", - widget.appo.projectName, - DateUtil.convertStringToDate(widget.appo.appointmentDate), - widget.appo.startTime.substring(0, 5), - null, - widget.appo.doctorRate, - widget.appo.actualDoctorRate, - widget.appo.noOfPatientsRate, - "", - //model.user.emailAddress, - ), - isNeedToShowButton: _tabController.index == 1, - buttonTitle: TranslationBase.of(context).schedule, - buttonIcon: 'assets/images/new/Boo_ Appointment.svg', - showConfirmMessageDialog: false, - onRatingAndReviewTap: getDoctorRatingsDetails, - onTap: () { - Navigator.push( - context, - FadePage( - page: SchedulePage(doctorList: doctorList, appo: widget.appo), - ), - ).then((value) { - setState(() { - widget.doctorSchedule = value; - }); - }); - }, - ), - SizedBox(height: 10), - TabBar( - onTap: (index) { - setState(() { - if (index == 1) { - if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) { - _tabController.index = _tabController.previousIndex; - AppointmentDetails.showFooterButton = false; - } else { - AppointmentDetails.showFooterButton = true; - } - } - }); - }, - tabs: [ - Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor - ? Tab( - child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), - ) - : Tab( - child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)), - ) - ], - controller: _tabController, + DoctorHeader( + headerModel: HeaderModel( + widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, + widget.appo.doctorImageURL, + widget.appo.doctorSpeciality, + "", + widget.appo.projectName, + DateUtil.convertStringToDate(widget.appo.appointmentDate), + widget.appo.startTime.substring(0, 5), + null, + widget.appo.doctorRate, + widget.appo.actualDoctorRate, + widget.appo.noOfPatientsRate, + "", + //model.user.emailAddress, + ), + isNeedToShowButton: _tabController.index == 1, + buttonTitle: TranslationBase.of(context).schedule, + buttonIcon: 'assets/images/new/Boo_ Appointment.svg', + showConfirmMessageDialog: false, + onRatingAndReviewTap: getDoctorRatingsDetails, + onTap: () { + Navigator.push( + context, + FadePage( + page: SchedulePage(doctorList: doctorList, appo: widget.appo), ), + ).then((value) { + setState(() { + widget.doctorSchedule = value; + }); + }); + }, + ), + SizedBox(height: 10), + Material( + color: Color(0xffF8F8F8), + child: TabBar( + onTap: (index) { + setState(() { + if (index == 1) { + if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) { + _tabController.index = _tabController.previousIndex; + AppointmentDetails.showFooterButton = false; + } else { + AppointmentDetails.showFooterButton = true; + } + } + }); + }, + tabs: [ + Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor + ? Tab( + child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), + ) + : Tab( + child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)), + ) ], + controller: _tabController, ), ), Container( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index df425e0f..a06045ec 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -20,12 +20,12 @@ class AskDoctorPage extends StatelessWidget { onModelReady: (model) => model.getMyDoctor(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital), + body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model), ), ); } - Widget _appointmentExpandableList(List _patientDoctorAppointmentList) { + Widget _appointmentExpandableList(List _patientDoctorAppointmentList, model) { return ListView.separated( physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), @@ -64,6 +64,21 @@ class AskDoctorPage extends StatelessWidget { return DoctorView( doctor: doctorList, isLiveCareAppointment: false, + onTap: () { + model.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((value) { + if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { + // Navigator.pop(context); + Navigator.push( + context, + FadePage( + page: RequestTypePage(doctorList: _doctor), + ), + ); + } else { + AppToast.showErrorToast(message: model.error); + } + }); + }, ); }, separatorBuilder: (context, index) => SizedBox(height: 14), diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index eaf2913d..0195ee3b 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -43,16 +43,13 @@ class _RequestTypePageState extends State { (index) => Container( width: double.maxFinite, height: 55, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8.0)), margin: EdgeInsets.all(8.0), child: InkWell( onTap: () { setState(() { selected = model.askDoctorReqTypes[index].description; - parameterCode = - model.askDoctorReqTypes[index].parameterCode; + parameterCode = model.askDoctorReqTypes[index].parameterCode; }); }, child: Row( @@ -60,8 +57,7 @@ class _RequestTypePageState extends State { children: [ Padding( padding: const EdgeInsets.all(8.0), - child: Text( - model.askDoctorReqTypes[index].description), + child: Text(model.askDoctorReqTypes[index].description), ), Radio( value: model.askDoctorReqTypes[index].description, @@ -70,8 +66,7 @@ class _RequestTypePageState extends State { onChanged: (value) { setState(() { selected = value; - parameterCode = model - .askDoctorReqTypes[index].parameterCode; + parameterCode = model.askDoctorReqTypes[index].parameterCode; }); }, ), @@ -113,14 +108,8 @@ class _RequestTypePageState extends State { loading: model.state == ViewState.BusyLocal, textColor: Colors.white, onTap: () { - model - .sendRequestLOV( - doctorList: widget.doctorList, - requestType: parameterCode.toString(), - remark: question) - .then((value) { - if (model.state != ViewState.ErrorLocal || - model.state != ViewState.Error) { + model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { + if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { Navigator.pop(context); } }); diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index d46676c3..76a6d839 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -53,7 +53,7 @@ class PrescriptionItemsPage extends StatelessWidget { "", prescriptions.name, DateUtil.convertStringToDate(prescriptions.appointmentDate), - null, + DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)), prescriptions.nationalityFlagURL, prescriptions.doctorRate, prescriptions.actualDoctorRate, diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index af964645..8e4a7c9a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -40,7 +40,7 @@ class DoctorHeader extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: EdgeInsets.only(left: 21, right: 21, bottom: 21), + padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -57,10 +57,11 @@ class DoctorHeader extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - _speciality, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), - ), + if (_speciality.isNotEmpty) + Text( + _speciality, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo) : Container(), myRichText(TranslationBase.of(context).branch, headerModel.projectName), ], @@ -70,89 +71,92 @@ class DoctorHeader extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - if (headerModel.date != null) Text( - DateUtil.formatDateToDate(headerModel.date), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), - if (headerModel.time != null) Text( - headerModel.time ?? DateUtil.formatDateToTime(headerModel.date), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), - ), + if (headerModel.date != null) + Text( + DateUtil.formatDateToDate(headerModel.date), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + if (headerModel.time != null) + Text( + headerModel.time ?? DateUtil.formatDateToTime(headerModel.date), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + if (headerModel?.nationalityFlagURL != null) + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), + ), ], ) ], ), ), - if(headerModel.actualDoctorRate!=null) - SizedBox( - height: 43, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: onRatingAndReviewTap, - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(width: 21), - RatingBar.readOnly( - initialRating: headerModel.actualDoctorRate + 0.0, - size: 15.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - SizedBox(width: 6), - Text( - "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.48, - height: 18 / 12, - decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, + if (headerModel.actualDoctorRate != null) + SizedBox( + height: 43, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: onRatingAndReviewTap, + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(width: 21), + RatingBar.readOnly( + initialRating: headerModel.actualDoctorRate + 0.0, + size: 15.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, ), - ), - ], - ), - ), - isNeedToShowButton - ? InkWell( - onTap: () { - if (showConfirmMessageDialog) - showConfirmMessage(context, onTap, headerModel.email); - else - onTap(); - }, - child: Container( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), - SizedBox(width: 6), - Text( - buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), - ), - ], + SizedBox(width: 6), + Text( + "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12, + decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, ), ), - ) - : Container(), - ], - ), - ) + ], + ), + ), + isNeedToShowButton + ? InkWell( + onTap: () { + if (showConfirmMessageDialog) + showConfirmMessage(context, onTap, headerModel.email); + else + onTap(); + }, + child: Container( + padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), + decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), + SizedBox(width: 6), + Text( + buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), + ), + ], + ), + ), + ) + : Container(), + ], + ), + ) ], ), );