From 9fecf8e89f186320ed21510fe46357738d5b294b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:34:02 +0200 Subject: [PATCH 1/3] fix insurance update --- .../FamilyFiles/GetAllSharedRecordByStatusResponse.dart | 4 ++-- lib/pages/insurance/insurance_update_screen.dart | 6 ++++-- lib/splashPage.dart | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart index b21d940f..750cf0be 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -25,7 +25,7 @@ class GetAllSharedRecordsByStatusResponse { dynamic successMsgN; dynamic doctorInformationList; List getAllPendingRecordsList; - List getAllSharedRecordsByStatusList; + List getAllSharedRecordsByStatusList = List(); List getResponseFileList; bool isHMGPatient; bool isLoginSuccessfully; @@ -92,7 +92,7 @@ class GetAllSharedRecordsByStatusResponse { this.successMsgN, this.doctorInformationList, this.getAllPendingRecordsList, - this.getAllSharedRecordsByStatusList, + this.getAllSharedRecordsByStatusList , this.getResponseFileList, this.isHMGPatient, this.isLoginSuccessfully, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 1e616108..f2f66031 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -97,7 +97,9 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: ListView.builder( + child: + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? + ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( @@ -173,7 +175,7 @@ class _InsuranceUpdateState extends State ), ), ); - }), + }):Container(), ), Container( child: ListView.builder( diff --git a/lib/splashPage.dart b/lib/splashPage.dart index d367d3ec..2c12d6fd 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -42,9 +42,9 @@ class _SplashScreenState extends State { var data = await sharedPref.getObject(USER_PROFILE); if (data != null) { AuthenticatedUser userData = AuthenticatedUser.fromJson(data); - Provider.of(context, listen: false).isLogin = true; - authenticatedUserObject.isLogin = true; - authenticatedUserObject.user = userData; + // Provider.of(context, listen: false).isLogin = true; + //authenticatedUserObject.isLogin = true; + //authenticatedUserObject.user = userData; } } From 554ed1b50a4f4e020421d7807c427c4c0eba87ed Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:55:27 +0200 Subject: [PATCH 2/3] fix insurance update --- lib/config/localized_values.dart | 7 +- .../insurance/insurance_update_screen.dart | 236 +++++++++--------- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 28 ++- 4 files changed, 148 insertions(+), 124 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2498a679..2b596bfb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -483,7 +483,7 @@ const Map localizedValues = { "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, - "History": {"en": "History", "ar": "السجل"}, + "History": {"en": "History", "ar": "السجلات"}, "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, @@ -1164,5 +1164,8 @@ const Map localizedValues = { "en": "Request medical report", "ar": "طلب تقرير طبي" }, - + "insur-cards": { + "en": "Insurance Cards", + "ar": "بطاقات التأمين" + }, }; diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index f2f66031..b088d477 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; @@ -35,7 +36,7 @@ class _InsuranceUpdateState extends State onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBarTitle: 'Insurance Cards', + appBarTitle: TranslationBase.of(context).insurCards, isShowAppBar: true, baseViewModel: model, body: Scaffold( @@ -63,7 +64,7 @@ class _InsuranceUpdateState extends State controller: _tabController, isScrollable: true, indicatorWeight: 4.0, - indicatorColor: Colors.red, + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.symmetric( horizontal: 13.0, vertical: 2.0), @@ -72,13 +73,14 @@ class _InsuranceUpdateState extends State Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('Card'), + child: Texts(TranslationBase.of(context) + .updateInsuranceSubtitle), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], @@ -97,85 +99,99 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: - model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? - ListView.builder( - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.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, - 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, - child: Container( - margin: EdgeInsets.only( - top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientID.toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: 'Update', - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 + child: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList != + null + ? ListView.builder( + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.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, + 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, + 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, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], ), - ], + ), ), - ), - ) - ], + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) + ], + ), + ), ), - ), - ), - ); - }):Container(), + ); + }) + : Container(), ), Container( child: ListView.builder( @@ -212,35 +228,34 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), Text( - model.insuranceUpdate[index] - .createdOn, + model.user.firstName + + " " + + model.user.lastName, style: TextStyle( fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w500, letterSpacing: 1.0)), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .insuranceUpdate[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + ), + Texts( + model.insuranceUpdate[index] + .createdOn, + fontSize: 14, + color: Colors.black, + ), ], ), ), @@ -248,7 +263,6 @@ class _InsuranceUpdateState extends State Expanded( flex: 1, child: Container( -// height: MediaQuery.of(context).size.height * 0.12, margin: EdgeInsets.only(top: 20.0), child: Column( children: [ @@ -259,15 +273,13 @@ class _InsuranceUpdateState extends State Container( margin: EdgeInsets.only( top: 13.5, left: 2.0), - child: Text( - model - .insuranceUpdate[ - index] - .statusDescription, - textAlign: - TextAlign.center, - style: TextStyle( - fontSize: 12.0)), + child: Texts( + model.insuranceUpdate[index] + .statusDescription, + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.black, + ), ), ], ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 39048bca..5a055973 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -942,6 +942,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get completed => localizedValues['completed'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; + String get insurCards => localizedValues['insur-cards'][locale.languageCode]; } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 99a7ee2d..cdc6025a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -59,11 +59,13 @@ class AppScaffold extends StatelessWidget { this.isShowDecPage = true, this.isBottomBar, this.image, - this.infoList, this.imagesInfo}); + this.infoList, + this.imagesInfo}); @override Widget build(BuildContext context) { AppGlobal.context = context; + ProjectViewModel projectViewModel = Provider.of(context); return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -75,13 +77,15 @@ class AppScaffold extends StatelessWidget { headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - title: Texts( - authenticatedUserObject.isLogin || !isShowDecPage - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - color: Colors.white, - bold: true, - ), + title: Text( + authenticatedUserObject.isLogin || !isShowDecPage + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: + projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -129,13 +133,17 @@ class AppScaffold extends StatelessWidget { infoList: infoList, imagesInfo: imagesInfo, ) - : baseViewModel != null + : baseViewModel != null ? NetworkBaseView( child: buildBodyWidget(), baseViewModel: baseViewModel, ) : buildBodyWidget(), - bottomSheet: (Provider.of(context, listen: false).isLogin || !isShowDecPage)?bottomSheet:null, + bottomSheet: + (Provider.of(context, listen: false).isLogin || + !isShowDecPage) + ? bottomSheet + : null, //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() From 14f92f6c582bb7e7167f1959117117f2eb5782a3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 11:02:33 +0200 Subject: [PATCH 3/3] remove updated button --- .../insurance/insurance_update_screen.dart | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index b088d477..a7e7c32b 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,15 +1,11 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; class InsuranceUpdate extends StatefulWidget { @override @@ -31,6 +27,7 @@ class _InsuranceUpdateState extends State _tabController.dispose(); } + //TODO implement update card Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), @@ -144,6 +141,9 @@ class _InsuranceUpdateState extends State color: Colors.black, fontWeight: FontWeight.w500, ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -162,29 +162,30 @@ class _InsuranceUpdateState extends State ), ), ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .updateInsurance, - small: true, - textColor: Colors.white, - // color: Colors.grey, + if (false) + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 ), - //height: 45, - // width:90 - ), - ], + ], + ), ), - ), - ) + ) ], ), ), @@ -228,16 +229,17 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - model.user.firstName + - " " + - model.user.lastName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), + Texts( + model.user.firstName + + " " + + model.user.lastName, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -248,12 +250,17 @@ class _InsuranceUpdateState extends State .patientID .toString(), fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), + SizedBox( + height: 8, + ), Texts( model.insuranceUpdate[index] .createdOn, fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), ],