diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 6fd63f56..9792b4b9 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -654,7 +654,7 @@ class _AppointmentActionsState extends State { page: VitalSignDetailsScreen( appointmentNo: appoNo, projectID: projectID, - isNotOneAppointment: false, + isNotOneAppointment: true, ))); } diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 9a22eada..18ec666e 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -16,6 +17,9 @@ class _PaymentMethodState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).paymentMethod, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, body: Container( margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), child: SingleChildScrollView( @@ -27,9 +31,7 @@ class _PaymentMethodState extends State { Container( margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), alignment: Alignment.center, - child: Text(TranslationBase.of(context).selectPaymentOption, - style: TextStyle( - fontSize: 26.0, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 25.0), @@ -48,18 +50,13 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MADA" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), + side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Container( height: 120.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/mada.png"), + child: Image.asset("assets/images/new-design/mada.png"), ), ), ), @@ -77,18 +74,13 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "VISA" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), + side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Container( height: 120.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/visa.png"), + child: Image.asset("assets/images/new-design/visa.png"), ), ), ), @@ -114,18 +106,13 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MASTERCARD" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), + side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Container( height: 120.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/mastercard.png"), + child: Image.asset("assets/images/new-design/mastercard.png"), ), ), ), @@ -143,18 +130,13 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "Installment" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), + side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Container( height: 120.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/installment.png"), + child: Image.asset("assets/images/new-design/installment.png"), ), ), ), @@ -180,17 +162,12 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "ApplePay" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), + side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Container( height: 120.0, padding: EdgeInsets.all(20.0), - child: SvgPicture.asset( - "assets/images/new-design/applepay.svg"), + child: SvgPicture.asset("assets/images/new-design/applepay.svg"), ), ), ), @@ -211,25 +188,33 @@ class _PaymentMethodState extends State { ), ), bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.height * 0.1, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - Navigator.pop(context, selectedPaymentMethod); - }, - child: Text(TranslationBase.of(context).confirm, - style: TextStyle(fontSize: 18.0)), + padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), + color: Colors.white, + child: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + color: Colors.white, + // margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.height * 0.1, + height: 45.0, + child: RaisedButton( + color: CustomColors.accentColor, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.pop(context, selectedPaymentMethod); + }, + child: Text(TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + )), + ), ), ), ), diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 20e17593..adceb0e8 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -10,17 +10,13 @@ class AttachInsuranceCardImageDialog extends StatefulWidget { final String fileNo; final Function(File file, String image) image; - const AttachInsuranceCardImageDialog( - {Key key, this.name, this.fileNo, this.image}) - : super(key: key); + const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.image}) : super(key: key); @override - _AttachInsuranceCardImageDialogState createState() => - _AttachInsuranceCardImageDialogState(); + _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState(); } -class _AttachInsuranceCardImageDialogState - extends State { +class _AttachInsuranceCardImageDialogState extends State { @override void initState() { super.initState(); @@ -36,19 +32,41 @@ class _AttachInsuranceCardImageDialogState Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts(TranslationBase.of(context).attachInsuraceImage), + Text( + TranslationBase.of(context).attachInsuraceImage, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ), Divider(), - Texts(widget.name), + Padding( + padding: const EdgeInsets.only(left: 8, right: 8), + child: Text( + widget.name, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ), SizedBox( height: 3, ), - Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), + Text( + TranslationBase.of(context).fileNo + " " + widget.fileNo, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.48, + ), + ), SizedBox( height: 5.0, ), InkWell( onTap: () { - ImageOptions.showImageOptions(context, (String image,File file) { + ImageOptions.showImageOptions(context, (String image, File file) { setState(() { this.image = image; this.file = file; @@ -57,18 +75,18 @@ class _AttachInsuranceCardImageDialogState }, child: image == null ? Padding( - padding: const EdgeInsets.all(18.0), - child: Container( + padding: const EdgeInsets.all(18.0), + child: Container( width: double.maxFinite, height: 250, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - border: Border.all(color: Colors.grey, width: 1.5)), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), border: Border.all(color: Colors.grey, width: 1.5)), child: Column( crossAxisAlignment: CrossAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment., + // mainAxisAlignment: MainAxisAlignment., children: [ - SizedBox(height: 25,), + SizedBox( + height: 25, + ), Icon( Icons.camera_enhance_rounded, size: 85, @@ -77,17 +95,24 @@ class _AttachInsuranceCardImageDialogState mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.attach_file), - Texts(TranslationBase.of(context).selectAttachment.toUpperCase()) + Text( + TranslationBase.of(context).selectAttachment.toUpperCase(), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ) ], ), ], ), ), - ) + ) : Image.file( file, fit: BoxFit.fill, - height: 250, + height: 250, ), ), SizedBox( @@ -106,9 +131,14 @@ class _AttachInsuranceCardImageDialogState padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + color: Colors.red, + ), ), ), ), @@ -130,9 +160,13 @@ class _AttachInsuranceCardImageDialogState child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, + child: Text( + TranslationBase.of(context).ok.toUpperCase(), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), )), ), ), diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index cf58e815..e756e59c 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.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/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -45,142 +47,162 @@ class _InsuranceCardState extends State { description: TranslationBase.of(context).infoInsuranceCards, infoList: TranslationBase.of(context).infoInsuranceCardsPoints, imagesInfo: imagesInfo, - appBarIcons: [ - IconButton( - padding: EdgeInsets.zero, - icon: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - margin: EdgeInsets.only(right: 8), - padding: EdgeInsets.only(right: 4, left: 4), - child: Image.asset( - 'assets/images/medical/insurance_update_icon_.png', - height: SizeConfig.heightMultiplier * 5, - width: SizeConfig.heightMultiplier * 5, - ), + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + backgroundColor: CustomColors.accentColor, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Image.asset( + 'assets/images/medical/insurance_update_icon_.png', + color: Colors.white, ), - onPressed: () { - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, ), - ], + ), body: Container( - margin: EdgeInsets.only(left: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004, top: SizeConfig.screenWidth * 0.04), - child: ListView.builder( - itemCount: model.insurance == null ? 0 : model.insurance.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - backgroundColor: Colors.white, + child: ListView.separated( + itemCount: model.insurance == null ? 0 : model.insurance.length, + itemBuilder: (BuildContext context, int index) { + return Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 10, + right: 10, + top: index == 0 ? 10 : 0, + bottom: index == model.insurance.length - 1 ? 100 : 0, + ), + child: Card( + shape: cardRadius(12), + elevation: 2, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - height: 65.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 15.0), - child: Texts( - model.insurance[index].groupName, - ), + children: [ + Text( + model.insurance[index].groupName, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.64), + ), + mHeight(8), + Text( + TranslationBase.of(context).companyName + model.insurance[index].companyName, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.48), + ), + Divider( + thickness: 2, + color: Colors.black, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).category, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + Text( + model.insurance[index].subCategoryDesc, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), ], ), - ), - children: [ - Container( - padding: EdgeInsets.all(14), - width: double.infinity, - decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.grey, width: 0.2), borderRadius: BorderRadius.all(Radius.circular(2)), boxShadow: [ - BoxShadow( - color: Colors.white70, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).expirationDate, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), - ]), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).companyName + model.insurance[index].companyName, - fontSize: 20.0, - fontWeight: FontWeight.w700, + Text( + convertDateFormat( + model.insurance[index].cardValidTo, ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(TranslationBase.of(context).category, fontSize: 18.5), Texts(model.insurance[index].subCategoryDesc, fontSize: 18.5)], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(TranslationBase.of(context).expirationDate, fontSize: 18.5), - Texts( - convertDateFormat( - model.insurance[index].cardValidTo, - ), - fontSize: 18.5), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(TranslationBase.of(context).status + ": ", fontSize: 18.5), - model.insurance[index].isActive == true - ? Texts(TranslationBase.of(context).activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, fontSize: 17.9) - : Texts(TranslationBase.of(context).notActive, color: Colors.red, fontWeight: FontWeight.w900, fontSize: 17.9) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(TranslationBase.of(context).patientCard, fontSize: 18.5), Texts(model.insurance[index].patientCardID, fontSize: 18.5)], - ), - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context).policyNumber, - fontSize: 18.5, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).status + ": ", + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + model.insurance[index].isActive == true + ? Text( + TranslationBase.of(context).activeInsurence, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Colors.green), + ) + : Text( + TranslationBase.of(context).notActive, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: Colors.red, ), - Texts( - model.insurance[index].insurancePolicyNumber, - fontSize: 18.5, - ) - ]), - ], - ), - SizedBox( - height: 14.5, - ), - if (model.insurance[index].isActive == true) - Container( - color: Colors.transparent, - child: SecondaryButton( - onTap: () => {getDetails(model.insurance[index])}, - label: TranslationBase.of(context).seeDetails, - textColor: Colors.white, - ), - width: double.infinity, - ), - ], - ), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).patientCard, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + Text( + model.insurance[index].patientCardID, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).policyNumber, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ), + Text( + model.insurance[index].insurancePolicyNumber, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), + ) + ], ), ], ), + if (model.insurance[index].isActive == true) + SizedBox( + height: 8.5, + ), + if (model.insurance[index].isActive == true) + Container( + color: Colors.transparent, + child: SecondaryButton( + onTap: () => { + getDetails(model.insurance[index]), + }, + label: TranslationBase.of(context).seeDetails, + textColor: Colors.white, + ), + width: double.infinity, + ), ], ), ), - ); - }), + ), + ); + }, + separatorBuilder: (BuildContext context, int index) { + return mHeight(8); + }, + ), ), ), ); diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index 87035e0c..af7dbb44 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -3,9 +3,11 @@ import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -20,13 +22,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { final int patientID; final String name; - const InsuranceCardUpdateDetails( - {Key key, - this.insuranceCardDetailsModel, - this.patientIdentificationID, - this.patientID, - this.name}) - : super(key: key); + const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name}) : super(key: key); @override Widget build(BuildContext context) { @@ -36,290 +32,375 @@ class InsuranceCardUpdateDetails extends StatelessWidget { isShowAppBar: true, isShowDecPage: false, appBarTitle: TranslationBase.of(context).cardDetail, - body: SingleChildScrollView( - child: Column( - children: [ - ...List.generate( - insuranceCardDetailsModel.length, - (index) => Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: double.maxFinite, - margin: EdgeInsets.only(left: 8, right: 8, top: 8), - height: projectViewModel.isArabic ? 320 : 240, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: Color(0xff515B5D), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - insuranceCardDetailsModel[index].memberID, - textScaleFactor: 2.1, - style: TextStyle( - color: Colors.white, - letterSpacing: 8.0, - fontWeight: FontWeight.w400, - fontSize: 15), - ), - SizedBox( - height: 5, - ), - Texts( - insuranceCardDetailsModel[index].companyName, - fontSize: 14, - color: Colors.white, - ), - SizedBox( - height: 25, - ), - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).policyHolder, - color: Colors.white, - fontSize: 14, - ), - Texts( - insuranceCardDetailsModel[index] - .memberName, - color: Colors.white, - fontSize: 14, - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts(TranslationBase.of(context).policyNo, - color: Colors.white), - Texts( - insuranceCardDetailsModel[index] - .policyNumber, - color: Colors.white), - ], - ), - ), - ], - ), - SizedBox( - height: 25, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + children: [ + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return Container( + width: double.maxFinite, + // height: projectViewModel.isArabic ? 320 : 240, + // decoration: containerRadius(CustomColors.accentColor, 12), + child: Card( + shape: cardRadius(12), + color: CustomColors.accentColor, + elevation: 4, + child: Padding( + padding: const EdgeInsets.all(12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - TranslationBase.of(context) - .expiryDateTitle, - color: Colors.white, - fontSize: 12, + Text( + insuranceCardDetailsModel[index].memberID, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 16, + ), ), - Texts( - insuranceCardDetailsModel[index].dOB, - color: Colors.white, - fontSize: 12, + SizedBox( + height: 2, ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts( - TranslationBase.of(context).classTitle, - color: Colors.white, - fontSize: 12, + Text( + insuranceCardDetailsModel[index].companyName, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 14, + ), ), - Texts( - insuranceCardDetailsModel[index] - .subCategory, - color: Colors.white, - fontSize: 12, + SizedBox( + height: 14, ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts( - TranslationBase.of(context).approval, - color: Colors.white, - fontSize: 12, + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).policyHolder, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + Text( + insuranceCardDetailsModel[index].memberName, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontSize: 12, + ), + ), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).policyNo, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + Text( + insuranceCardDetailsModel[index].policyNumber, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontSize: 12, + ), + ), + ], + ), + ], ), - Texts( - insuranceCardDetailsModel[index] - .approvalLimit - .toString(), - color: Colors.white, - fontSize: 12, + SizedBox( + height: 14, ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).expiryDateTitle, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + Text( + insuranceCardDetailsModel[index].effectiveTo, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontSize: 12, + ), + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + TranslationBase.of(context).classTitle, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + Text( + insuranceCardDetailsModel[index].subCategory, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontSize: 12, + ), + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + TranslationBase.of(context).approval, + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + Text( + insuranceCardDetailsModel[index].approvalLimit.toString(), + style: TextStyle( + color: Colors.white, + letterSpacing: -0.48, + fontSize: 12, + ), + ), + ], + ), + ), + ], + ) ], ), ), - ], - ) - ], + ), + ); + }, + separatorBuilder: (context, index) { + return mHeight(12); + }, + itemCount: insuranceCardDetailsModel.length, ), - ), - ), - ), - ), - if(insuranceCardDetailsModel.isEmpty) - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB( - 8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, + if (insuranceCardDetailsModel.isEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Card( + color: Colors.white, + shape: cardRadius(12), child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: [ - Texts( - name, - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, - ), - SizedBox( - height: 8, + Expanded( + child: Container( + margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Text( + TranslationBase.of(context).fileno + ": " + patientID.toString(), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ) + ], + ), + ), ), - Texts( - TranslationBase.of( - context) - .fileno + - ": " +patientID.toString(), - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, - ) ], ), ), ), - ], - ), - ), - ), - ), - SizedBox(height: 150,), - Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), - SizedBox(height: 8,), - Texts(TranslationBase.of(context).noDataAvailable) - ], - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - child: Column( - children: [ - SizedBox( - height: 8, - ), - if(insuranceCardDetailsModel.isEmpty) - SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).scanNow.toUpperCase(), - color: Theme.of(context).primaryColor, - small: true, - onTap: () async { - confirmAttachInsuranceCardImageDialogDialog( - context: context, - name: name, - fileNo: patientID.toString(), - model: model); - }, + ), + SizedBox( + height: 150, + ), + Image.asset( + 'assets/images/no-data-found.png', + width: 80, + height: 80, + ), + SizedBox( + height: 8, + ), + Text( + TranslationBase.of(context).noDataAvailable, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + ) + ], + ) + ], ), - if(insuranceCardDetailsModel.isNotEmpty) - SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).agree.toUpperCase(), - color: Theme.of(context).primaryColor, - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.uploadInsuranceCard( - patientIdentificationID: patientIdentificationID, - patientID: patientID); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast( - message: TranslationBase.of(context).requestSent); - } - }, - ),if(insuranceCardDetailsModel.isNotEmpty) - SizedBox( - height: 12, - ),if(insuranceCardDetailsModel.isNotEmpty) - SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).disagree.toUpperCase(), - color: Colors.grey[800], - onTap: () async { - confirmAttachInsuranceCardImageDialogDialog( - context: context, - name: name, - fileNo: patientID.toString(), - model: model); - }, - ) - ], + ), + ), + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + children: [ + if (insuranceCardDetailsModel.isEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).scanNow.toUpperCase(), + color: CustomColors.accentColor, + small: true, + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + }, + ), + if (insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).agree.toUpperCase(), + color: CustomColors.accentColor, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); + } + }, + ), + if (insuranceCardDetailsModel.isNotEmpty) + SizedBox( + height: 12, + ), + if (insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).disagree.toUpperCase(), + color: Colors.grey[800], + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + }, + ) + ], + ), ), - ), + ], ), + // bottomSheet: Container( + // width: double.infinity, + // height: insuranceCardDetailsModel.isEmpty ? MediaQuery.of(context).size.height * 0.14 : MediaQuery.of(context).size.height * 0.21, + // child: Container( + // margin: EdgeInsets.only(left: 8, right: 8), + // child: Column( + // children: [ + // SizedBox( + // height: 8, + // ), + // if (insuranceCardDetailsModel.isEmpty) + // SecondaryButton( + // textColor: Colors.white, + // label: TranslationBase.of(context).scanNow.toUpperCase(), + // color: Theme.of(context).primaryColor, + // small: true, + // onTap: () async { + // confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + // }, + // ), + // if (insuranceCardDetailsModel.isNotEmpty) + // SecondaryButton( + // textColor: Colors.white, + // label: TranslationBase.of(context).agree.toUpperCase(), + // color: Theme.of(context).primaryColor, + // onTap: () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID); + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // AppToast.showErrorToast(message: model.error); + // } else { + // AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); + // } + // }, + // ), + // if (insuranceCardDetailsModel.isNotEmpty) + // SizedBox( + // height: 12, + // ), + // if (insuranceCardDetailsModel.isNotEmpty) + // SecondaryButton( + // textColor: Colors.white, + // label: TranslationBase.of(context).disagree.toUpperCase(), + // color: Colors.grey[800], + // onTap: () async { + // confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + // }, + // ) + // ], + // ), + // ), + // ), ), ); } - void confirmAttachInsuranceCardImageDialogDialog( - {BuildContext context, - String name, - String fileNo, - InsuranceViewModel model}) { + void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) { showDialog( context: context, child: AttachInsuranceCardImageDialog( @@ -327,17 +408,12 @@ class InsuranceCardUpdateDetails extends StatelessWidget { name: name, image: (file, image) async { GifLoaderDialogUtils.showMyDialog(context); - await model.uploadInsuranceCard( - patientIdentificationID: patientIdentificationID, - patientID: patientID, - image: image); + await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID, image: image); GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal || - model.state == ViewState.Error) { + if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) { AppToast.showErrorToast(message: model.error); } else { - AppToast.showSuccessToast( - message: TranslationBase.of(context).requestSent); + AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); } Navigator.pop(context); }, diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index 16745e9e..f2fe64cf 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter_html/flutter_html.dart'; @@ -17,6 +18,9 @@ class InsuranceCardDetails extends StatelessWidget { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).cardDetail, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, body: Center( child: SingleChildScrollView( child: Html( diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index a391f554..7b740895 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.d import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -17,223 +18,137 @@ class InsurancePage extends StatelessWidget { InsuranceCardService _insuranceCardService = locator(); InsurancePage({Key key, this.model}) : super(key: key); + @override Widget build(BuildContext context) { return SingleChildScrollView( - child: Column( - children: [ - SizedBox( - height: 65, - ), - Container( - margin: EdgeInsets.all(10.0), - color: Colors.white, - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - if (model.user != null) - Expanded( - flex: 3, - child: Container( - margin: - EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - model.user.firstName + " " + model.user.lastName, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context).fileno + - ": " + - model.user.patientID.toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - margin: EdgeInsets.only(top: 2.0), - child: Column( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: double.infinity, + child: Card( + shape: cardRadius(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: InkWell( + onTap: () { + getDetails( + setupID: '010266', + projectID: 15, + patientIdentificationID: model.user.patientIdentificationNo, + patientID: model.user.patientID, + name: model.user.firstName + " " + model.user.lastName, + context: context, + ); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.max, children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of(context).fetchData, - small: true, - textColor: Colors.white, - onTap: () { - getDetails( - setupID: '010266', - projectID: 15, - patientIdentificationID: - model.user.patientIdentificationNo, - patientID: model.user.patientID, - name: model.user.firstName + - " " + - model.user.lastName, - context: context); - }, + if (model.user != null) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.user.firstName + " " + model.user.lastName, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Text( + TranslationBase.of(context).fileno + ": " + model.user.patientID.toString(), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ) + ], + ), ), - ), + Icon(Icons.arrow_forward), ], ), ), - ) - ], + ), + ), ), - ), - if (model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList != - null ?? - false) - ...List.generate( - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList.length, - (index) => model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[index].status == - 3 - ? Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), + if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + ? InkWell( + onTap: () { + getDetails( + projectID: 15, + patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, + setupID: '010266', + patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, + name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, + context: context); + }, child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context).fileno + - ": " + - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of(context) - .fetchData, - small: true, - textColor: Colors.white, - onTap: () { - getDetails( - projectID: 15, - patientIdentificationID: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientIdenficationNumber, - setupID: '010266', - patientID: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .responseID, - name: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName, - context: context); - }, + width: double.infinity, + child: Card( + shape: cardRadius(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46), + ), + Text( + TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientID.toString(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46), ), - ), - ], + ], + ), ), - ), - ) - ], + Icon(Icons.arrow_forward), + ], + ), + ), ), ), - ), - ) - : Container()), - ], + ) + : Container(); + }, + separatorBuilder: (context, index) { + return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0); + }, + itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, + ), + ], + ), ), ); } - getDetails( - {String setupID, - int projectID, - String patientIdentificationID, - int patientID, - String name, - BuildContext context}) { + getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, BuildContext context}) { GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService - .getPatientInsuranceDetails( - setupID: setupID, - projectID: projectID, - patientID: patientID, - patientIdentificationID: patientIdentificationID) - .then((value) { + _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID).then((value) { GifLoaderDialogUtils.hideDialog(context); - if (!_insuranceCardService.hasError && - _insuranceCardService.isHaveInsuranceCard) { + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { Navigator.push( context, FadePage( page: InsuranceCardUpdateDetails( - insuranceCardDetailsModel: - _insuranceCardService.insuranceCardDetailsList, + insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, patientID: patientID, patientIdentificationID: patientIdentificationID, name: name, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 6c3ee61c..dc035859 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -23,20 +24,17 @@ class InsuranceUpdate extends StatefulWidget { _InsuranceUpdateState createState() => _InsuranceUpdateState(); } -class _InsuranceUpdateState extends State - with SingleTickerProviderStateMixin { +class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); + @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); } void dispose() { @@ -47,8 +45,7 @@ class _InsuranceUpdateState extends State Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).insurCards, description: TranslationBase.of(context).infoInsurCards, infoList: TranslationBase.of(context).infoPrescriptionsPoints, @@ -56,79 +53,67 @@ class _InsuranceUpdateState extends State isShowAppBar: true, isShowDecPage: true, baseViewModel: model, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(70.0), - child: Stack( - children: [ - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 1.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 5.7, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + Container( + height: 45, + child: TabBar( + controller: _tabController, + isScrollable: false, + indicatorWeight: 3.0, + indicatorColor: CustomColors.accentColor, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Colors.grey, + tabs: [ + Container( + child: Center( + child: Text( + TranslationBase.of(context).updateInsuranceSubtitle, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), ), - color: Colors.white, ), + ), + Container( child: Center( - child: TabBar( - controller: _tabController, - isScrollable: true, - indicatorWeight: 4.0, - indicatorColor: Theme.of(context).primaryColor, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.symmetric( - horizontal: 13.0, vertical: 2.0), - unselectedLabelColor: Colors.grey, - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: Texts(TranslationBase.of(context) - .updateInsuranceSubtitle), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: Texts(TranslationBase.of(context).history), - ), - ), - ], + child: Text( + TranslationBase.of(context).history, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), ), ), ), - ) - ], + ], + ), ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - InsurancePage(model: model), - Container( + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + InsurancePage(model: model), + Container( + child: Padding( + padding: const EdgeInsets.all(12.0), child: ListView.builder( - itemCount: model.insuranceUpdate == null - ? 0 - : model.insuranceUpdate.length, + itemCount: model.insuranceUpdate == null ? 0 : model.insuranceUpdate.length, itemBuilder: (BuildContext context, int index) { return Container( - margin: EdgeInsets.all(10.0), child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, + elevation: 2, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(12), ), child: Container( width: MediaQuery.of(context).size.width, @@ -143,47 +128,37 @@ class _InsuranceUpdateState extends State Expanded( flex: 3, child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), + margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - model.user.firstName + - " " + - model.user.lastName, - fontSize: 14, - fontWeight: FontWeight.w500, - color: Colors.black, + Text( + model.user.firstName + " " + model.user.lastName, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - fontSize: 14, - fontWeight: FontWeight.w500, - color: Colors.black, + height: 4, ), - SizedBox( - height: 8, + Text( + TranslationBase.of(context).fileno + ": " + model.insuranceUpdate[index].patientID.toString(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), - Texts( - model.insuranceUpdate[index] - .createdOn, - fontSize: 14, - fontWeight: FontWeight.w500, - color: Colors.black, + + Text( + model.insuranceUpdate[index].createdOn, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), ], ), @@ -195,19 +170,16 @@ class _InsuranceUpdateState extends State margin: EdgeInsets.only(top: 20.0), child: Column( children: [ - Image.asset( - "assets/images/new-design/confirm_button.png", - width: 30.0, - height: 30.0), + Image.asset("assets/images/new-design/confirm_button.png", width: 30.0, height: 30.0), Container( - margin: EdgeInsets.only( - top: 13.5, left: 2.0), - child: Texts( - model.insuranceUpdate[index] - .statusDescription, - textAlign: TextAlign.center, - fontSize: 12, - color: Colors.black, + margin: EdgeInsets.only(top: 6.5, left: 2.0), + child: Text( + model.insuranceUpdate[index].statusDescription, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), ), ], @@ -223,10 +195,10 @@ class _InsuranceUpdateState extends State ); }), ), - ], - )) - ], - ), + ), + ], + )) + ], ), ), ); diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index d3921d4a..fe7e9423 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -57,10 +58,8 @@ class _AdvancePaymentPageState extends State { super.initState(); getAuthUser(); imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); } @override @@ -72,6 +71,9 @@ class _AdvancePaymentPageState extends State { imagesInfo: imagesInfo, appBarTitle: TranslationBase.of(context).advancePayment, description: TranslationBase.of(context).infoAdvancePayment, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -79,9 +81,14 @@ class _AdvancePaymentPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + Text( TranslationBase.of(context).advancePaymentLabel, textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), SizedBox( height: 12, @@ -89,16 +96,21 @@ class _AdvancePaymentPageState extends State { InkWell( onTap: () => confirmSelectBeneficiaryDialog(model), child: Container( - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(8), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getBeneficiaryType()), + Text( + getBeneficiaryType(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), Icon(Icons.arrow_drop_down) ], ), @@ -114,23 +126,26 @@ class _AdvancePaymentPageState extends State { GifLoaderDialogUtils.showMyDialog(context); model.getFamilyFiles().then((value) { GifLoaderDialogUtils.hideDialog(context); - confirmSelectFamilyDialog(model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList); + confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList); }); }, child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getFamilyMembersName()), - Icon(Icons.arrow_drop_down) + Text( + getFamilyMembersName(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Icon(Icons.arrow_drop_down), ], ), ), @@ -151,29 +166,30 @@ class _AdvancePaymentPageState extends State { onTap: () { if (_fileTextController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model - .getPatientInfoByPatientID( - id: _fileTextController.text) - .then((value) { + model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) { GifLoaderDialogUtils.hideDialog(context); confirmSelectPatientDialog(model.patientInfoList); }); } else - AppToast.showErrorToast( - message: 'Please Enter The File Number'); + AppToast.showErrorToast(message: 'Please Enter The File Number'); }, child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getPatientName()), - Icon(Icons.arrow_drop_down) + Text( + getPatientName(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Icon(Icons.arrow_drop_down), ], ), ), @@ -187,14 +203,19 @@ class _AdvancePaymentPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName()), - Icon(Icons.arrow_drop_down) + Text( + getHospitalName(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Icon(Icons.arrow_drop_down), ], ), ), @@ -237,15 +258,15 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: 90, + height: 70, width: double.infinity, - padding: EdgeInsets.all(18), + padding: EdgeInsets.all(12), + color: Colors.white, child: SecondaryButton( textColor: Colors.white, label: TranslationBase.of(context).submit, - disabled: amount.isEmpty || - _fileTextController.text.isEmpty || - _selectedHospital == null, + color: CustomColors.accentColor, + disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, onTap: () { var mobileNum; var patientName; @@ -273,15 +294,11 @@ class _AdvancePaymentPageState extends State { advanceModel.mobileNumber = mobileNum; advanceModel.patientName = patientName; GifLoaderDialogUtils.showMyDialog(context); - model - .getPatientInfoByPatientIDAndMobileNumber(advanceModel) - .then((value) { + model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.Error && - model.state != ViewState.ErrorLocal) { + if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { Utils.hideKeyboard(context); - Navigator.push(context, FadePage(page: PaymentMethod())) - .then( + Navigator.push(context, FadePage(page: PaymentMethod())).then( (value) { Navigator.push( context, @@ -289,8 +306,7 @@ class _AdvancePaymentPageState extends State { page: ConfirmPaymentPage( advanceModel: advanceModel, selectedPaymentMethod: value, - patientInfoAndMobileNumber: - model.patientInfoAndMobileNumber, + patientInfoAndMobileNumber: model.patientInfoAndMobileNumber, authenticatedUser: authUser, ), ), @@ -314,8 +330,7 @@ class _AdvancePaymentPageState extends State { setState(() { if (value == BeneficiaryType.MyAccount) { _fileTextController.text = model.user.patientID.toString(); - advanceModel.depositorName = - model.user.firstName + " " + model.user.lastName; + advanceModel.depositorName = model.user.firstName + " " + model.user.lastName; } else _fileTextController.text = ""; @@ -357,8 +372,7 @@ class _AdvancePaymentPageState extends State { ); } - void confirmSelectFamilyDialog( - List getAllSharedRecordsByStatusList) { + void confirmSelectFamilyDialog(List getAllSharedRecordsByStatusList) { if (getAllSharedRecordsByStatusList.isNotEmpty) showDialog( context: context, @@ -368,8 +382,7 @@ class _AdvancePaymentPageState extends State { onValueSelected: (value) { setState(() { selectedPatientFamily = value; - _fileTextController.text = - selectedPatientFamily.responseID.toString(); + _fileTextController.text = selectedPatientFamily.responseID.toString(); advanceModel.depositorName = value.patientName; }); }, @@ -409,8 +422,7 @@ class _AdvancePaymentPageState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index eecb6abd..f5d14efe 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -32,11 +33,7 @@ class ConfirmPaymentPage extends StatelessWidget { AppSharedPreferences sharedPref = AppSharedPreferences(); String transID = ""; - ConfirmPaymentPage( - {this.advanceModel, - this.patientInfoAndMobileNumber, - this.selectedPaymentMethod, - this.authenticatedUser}); + ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); @override Widget build(BuildContext context) { @@ -51,11 +48,9 @@ class ConfirmPaymentPage extends StatelessWidget { print("dialog dismissed"); print(value); if (value != null && value) { - AppoitmentAllHistoryResultList appo = - new AppoitmentAllHistoryResultList(); + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = patientInfoAndMobileNumber.projectID; - openPayment(selectedPaymentMethod, authenticatedUser, - double.parse(advanceModel.amount), null); + openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null); } }); } @@ -64,6 +59,9 @@ class ConfirmPaymentPage extends StatelessWidget { builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).advancePayment, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -71,11 +69,14 @@ class ConfirmPaymentPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + Text( TranslationBase.of(context).confirmThePayment, textAlign: TextAlign.center, - fontWeight: FontWeight.w500, - fontSize: 24, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), ), SizedBox( height: 12, @@ -89,10 +90,13 @@ class ConfirmPaymentPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.45, child: Image.asset(getImagePath(selectedPaymentMethod)), ), - Texts( + Text( '${advanceModel.amount} SAR', - fontSize: 26, - bold: true, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w900, + letterSpacing: -0.48, + ), ) ], ), @@ -136,11 +140,7 @@ class ConfirmPaymentPage extends StatelessWidget { ), NewTextFields( hintText: TranslationBase.of(context).depositorName, - initialValue: model.user.firstName + - " " + - model.user.middleName + - " " + - model.user.lastName, + initialValue: model.user.firstName + " " + model.user.middleName + " " + model.user.lastName, isEnabled: false, ), SizedBox( @@ -156,26 +156,24 @@ class ConfirmPaymentPage extends StatelessWidget { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, - width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: Theme.of(context).primaryColor, - label: TranslationBase.of(context).confirm.toUpperCase(), - disabled: model.state == ViewState.Busy, - onTap: () { - GifLoaderDialogUtils.showMyDialog(context); - model - .sendActivationCodeForAdvancePayment( - patientID: int.parse(advanceModel.fileNumber), - projectID: advanceModel.hospitalsModel.iD) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.ErrorLocal && - model.state != ViewState.Error) showSMSDialog(); - }); - }, + color: Colors.white, + child: Container( + height: MediaQuery.of(context).size.width * 0.18, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: CustomColors.accentColor, + label: TranslationBase.of(context).confirm.toUpperCase(), + disabled: model.state == ViewState.Busy, + onTap: () { + GifLoaderDialogUtils.showMyDialog(context); + model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); + }); + }, + ), ), ), ), @@ -204,29 +202,13 @@ class ConfirmPaymentPage extends StatelessWidget { return 'assets/images/new-design/mada.png'; } - openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, - double amount, AppoitmentAllHistoryResultList appo) { - browser = new MyInAppBrowser( - onExitCallback: onBrowserExit, - appo: appo, - onLoadStartCallback: onBrowserLoadStart); + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID( - advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber)); + transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber)); - browser.openPaymentBrowser( - amount, - "Advance Payment", - transID, - advanceModel.hospitalsModel.iD.toString(), - advanceModel.email, - paymentMethod, - patientInfoAndMobileNumber.patientType, - advanceModel.patientName, - advanceModel.fileNumber, - authenticatedUser, - browser, - false); + browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType, + advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false); } onBrowserLoadStart(String url) { @@ -278,23 +260,11 @@ class ConfirmPaymentPage extends StatelessWidget { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - service.HIS_createAdvancePayment( - appo, - advanceModel.hospitalsModel.iD.toString(), - res['Amount'], - res['Fort_id'], - res['PaymentMethod'], - patientInfoAndMobileNumber.patientType, - advanceModel.patientName, - advanceModel.fileNumber, - AppGlobal.context) + service.HIS_createAdvancePayment(appo, advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], patientInfoAndMobileNumber.patientType, + advanceModel.patientName, advanceModel.fileNumber, AppGlobal.context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest( - res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), - paymentReference, - 0, - appo); + addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); @@ -302,13 +272,9 @@ class ConfirmPaymentPage extends StatelessWidget { }); } - addAdvancedNumberRequest(String advanceNumber, String paymentReference, - dynamic appointmentID, AppoitmentAllHistoryResultList appo) { + addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - service - .addAdvancedNumberRequest( - advanceNumber, paymentReference, appointmentID, AppGlobal.context) - .then((res) { + service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(AppGlobal.context); navigateToHome(AppGlobal.context); diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart index d7ce3fac..731632c9 100644 --- a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -10,12 +10,10 @@ class SelectBeneficiaryDialog extends StatefulWidget { final BeneficiaryType beneficiaryType; final Function(BeneficiaryType) onValueSelected; - SelectBeneficiaryDialog( - {Key key, this.beneficiaryType, this.onValueSelected}); + SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected}); @override - _SelectBeneficiaryDialogState createState() => - _SelectBeneficiaryDialogState(this.beneficiaryType); + _SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType); } class _SelectBeneficiaryDialogState extends State { @@ -42,7 +40,14 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: Text(TranslationBase.of(context).myAccount), + title: Text( + TranslationBase.of(context).myAccount, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: BeneficiaryType.MyAccount, groupValue: beneficiaryType, @@ -72,7 +77,14 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: Text(TranslationBase.of(context).myFamilyFiles), + title: Text( + TranslationBase.of(context).myFamilyFiles, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: BeneficiaryType.MyFamilyFiles, groupValue: beneficiaryType, @@ -102,7 +114,14 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: Text(TranslationBase.of(context).otherAccount), + title: Text( + TranslationBase.of(context).otherAccount, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: BeneficiaryType.OtherAccount, groupValue: beneficiaryType, @@ -134,9 +153,14 @@ class _SelectBeneficiaryDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.red, + ), ), ), ), @@ -158,9 +182,13 @@ class _SelectBeneficiaryDialogState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, + child: Text( + TranslationBase.of(context).ok.toUpperCase(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), ), ), diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index a9a4fea2..4307637e 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -11,8 +11,7 @@ class SelectHospitalDialog extends StatefulWidget { final Function(HospitalsModel) onValueSelected; HospitalsModel selectedHospital; - SelectHospitalDialog( - {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + SelectHospitalDialog({Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); @override _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); @@ -51,8 +50,14 @@ class _SelectHospitalDialogState extends State { }); }, child: ListTile( - title: Text(widget.hospitals[index].name + - ' ${widget.hospitals[index].distanceInKilometers} KM'), + title: Text( + widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: widget.hospitals[index], groupValue: widget.selectedHospital, @@ -90,9 +95,14 @@ class _SelectHospitalDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.red + ), ), ), ), @@ -114,10 +124,15 @@ class _SelectHospitalDialogState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + child: Text( + TranslationBase.of(context).ok, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + ), ), ), ), diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index ab2b48d5..445eb3c8 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -7,22 +7,21 @@ import 'package:flutter/material.dart'; import '../../../../Constants.dart'; class SelectPatientFamilyDialog extends StatefulWidget { - final List getAllSharedRecordsByStatusList; + final List getAllSharedRecordsByStatusList; final Function(GetAllSharedRecordsByStatusList) onValueSelected; GetAllSharedRecordsByStatusList selectedPatientFamily; - SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); + SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily}); @override _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); } class _SelectPatientFamilyDialogState extends State { - @override void initState() { super.initState(); - widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; + widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0]; } @override @@ -34,7 +33,7 @@ class _SelectPatientFamilyDialogState extends State { Divider(), ...List.generate( widget.getAllSharedRecordsByStatusList.length, - (index) => Column( + (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -51,7 +50,14 @@ class _SelectPatientFamilyDialogState extends State { }); }, child: ListTile( - title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), + title: Text( + widget.getAllSharedRecordsByStatusList[index].patientName, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: widget.getAllSharedRecordsByStatusList[index], groupValue: widget.selectedPatientFamily, @@ -89,9 +95,14 @@ class _SelectPatientFamilyDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.red, + ), ), ), ), @@ -113,10 +124,15 @@ class _SelectPatientFamilyDialogState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + child: Text( + TranslationBase.of(context).ok, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + ), ), ), ), diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart index 3cce8e61..614ac86a 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -9,22 +9,22 @@ import 'package:flutter/material.dart'; import '../../../../Constants.dart'; class SelectPatientInfoDialog extends StatefulWidget { - final List patientInfoList ; + final List patientInfoList; + final Function(PatientInfo) onValueSelected; PatientInfo selectedPatientInfo; - SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); + SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo}); @override _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); } class _SelectPatientInfoDialogState extends State { - @override void initState() { super.initState(); - widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; + widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0]; } @override @@ -36,7 +36,7 @@ class _SelectPatientInfoDialogState extends State { Divider(), ...List.generate( widget.patientInfoList.length, - (index) => Column( + (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -53,7 +53,14 @@ class _SelectPatientInfoDialogState extends State { }); }, child: ListTile( - title: Text(widget.patientInfoList[index].fullName), + title: Text( + widget.patientInfoList[index].fullName, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), leading: Radio( value: widget.patientInfoList[index], groupValue: widget.selectedPatientInfo, @@ -91,9 +98,14 @@ class _SelectPatientInfoDialogState extends State { padding: const EdgeInsets.all(8.0), child: Container( child: Center( - child: Texts( + child: Text( TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.red, + ), ), ), ), @@ -115,10 +127,15 @@ class _SelectPatientInfoDialogState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + child: Text( + TranslationBase.of(context).ok.toUpperCase(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + ), ), ), ), diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index f097bda5..28e1510a 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -17,10 +18,7 @@ class MyBalancePage extends StatelessWidget { @override Widget build(BuildContext context) { imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); return BaseView( onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), builder: (_, model, w) => AppScaffold( @@ -29,16 +27,22 @@ class MyBalancePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).myBalances, imagesInfo: imagesInfo, description: TranslationBase.of(context).infoMyBalance, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, body: SingleChildScrollView( child: Container( margin: EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + Text( TranslationBase.of(context).balanceAmount, - color: Colors.black, - bold: true, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), SizedBox( height: 15, @@ -55,15 +59,22 @@ class MyBalancePage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.totalAdvanceBalanceAmount ?? 0} ' + - TranslationBase.of(context).sar, - color: Colors.white, - bold: true, + Text( + '${model.totalAdvanceBalanceAmount ?? 0} ' + TranslationBase.of(context).sar, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + color: Colors.white, + ), ), - Texts( + Text( TranslationBase.of(context).totalBalance, - color: Colors.white, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.46, + color: Colors.white, + ), ), ], ), @@ -80,18 +91,26 @@ class MyBalancePage extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(7), + borderRadius: BorderRadius.circular(12), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + - TranslationBase.of(context).sar, - bold: true, + Text( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + TranslationBase.of(context).sar, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), + ), + Text( + model.patientAdvanceBalanceAmountList[index].projectDescription, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.46, + ), ), - Texts(model.patientAdvanceBalanceAmountList[index] - .projectDescription), ], ), ), @@ -111,6 +130,7 @@ class MyBalancePage extends StatelessWidget { padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, + color: CustomColors.accentColor, label: TranslationBase.of(context).createAdvancedPayment, onTap: () { Navigator.push(context, FadePage(page: AdvancePaymentPage())); diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart index ec3eaf3b..2d19a2f8 100644 --- a/lib/pages/medical/balance/new_text_Field.dart +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -70,8 +70,8 @@ class NewTextFields extends StatefulWidget { this.prefixIcon, this.bare = false, this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, + this.fontSize = 14.0, + this.fontWeight = FontWeight.w600, this.autoValidate = false, this.hintColor, this.isEnabled = true,this.counterText=""}) diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 8c4ba851..06b71a61 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -242,10 +242,8 @@ class _SecondaryButtonState extends State style: TextStyle( color: widget.textColor, fontSize: widget.small ? 12.0 : 14.0, - // fontWeight: FontWeight.w800, - fontFamily: projectViewModel.isArabic - ? 'Cairo' - : 'WorkSans'), + fontWeight: FontWeight.w600, + ), ), ) ], diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 97a37ce1..a538b1c4 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,29 +4,27 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; + FadePage({this.page}) - : super( - opaque: false, - fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition( - opacity: animation, - child: child - ); - } - ); -} \ No newline at end of file + : super( + opaque: false, + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition(opacity: animation, child: child); + }, + ); +}