Update, Insurance card and My Balance Design

merge-update-with-lab-changes
Mirza.Shafique 5 years ago
parent 4f85652562
commit a234618df8

@ -654,7 +654,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
page: VitalSignDetailsScreen( page: VitalSignDetailsScreen(
appointmentNo: appoNo, appointmentNo: appoNo,
projectID: projectID, projectID: projectID,
isNotOneAppointment: false, isNotOneAppointment: true,
))); )));
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -16,6 +17,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod, appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView( child: SingleChildScrollView(
@ -27,9 +31,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(TranslationBase.of(context).selectPaymentOption, child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold)),
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 25.0), margin: EdgeInsets.only(top: 25.0),
@ -48,18 +50,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MADA" side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/mada.png"),
"assets/images/new-design/mada.png"),
), ),
), ),
), ),
@ -77,18 +74,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "VISA" side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/visa.png"),
"assets/images/new-design/visa.png"),
), ),
), ),
), ),
@ -114,18 +106,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MASTERCARD" side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/mastercard.png"),
"assets/images/new-design/mastercard.png"),
), ),
), ),
), ),
@ -143,18 +130,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "Installment" side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/installment.png"),
"assets/images/new-design/installment.png"),
), ),
), ),
), ),
@ -180,17 +162,12 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay" side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(20.0), padding: EdgeInsets.all(20.0),
child: SvgPicture.asset( child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
"assets/images/new-design/applepay.svg"),
), ),
), ),
), ),
@ -211,9 +188,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
color: Colors.white,
child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), color: Colors.white,
// margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -221,15 +202,19 @@ class _PaymentMethodState extends State<PaymentMethod> {
minWidth: MediaQuery.of(context).size.height * 0.1, minWidth: MediaQuery.of(context).size.height * 0.1,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () {
Navigator.pop(context, selectedPaymentMethod); Navigator.pop(context, selectedPaymentMethod);
}, },
child: Text(TranslationBase.of(context).confirm, child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)), style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
)),
),
), ),
), ),
), ),

@ -10,17 +10,13 @@ class AttachInsuranceCardImageDialog extends StatefulWidget {
final String fileNo; final String fileNo;
final Function(File file, String image) image; final Function(File file, String image) image;
const AttachInsuranceCardImageDialog( const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.image}) : super(key: key);
{Key key, this.name, this.fileNo, this.image})
: super(key: key);
@override @override
_AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState();
_AttachInsuranceCardImageDialogState();
} }
class _AttachInsuranceCardImageDialogState class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImageDialog> {
extends State<AttachInsuranceCardImageDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -36,19 +32,41 @@ class _AttachInsuranceCardImageDialogState
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Texts(TranslationBase.of(context).attachInsuraceImage), Text(
TranslationBase.of(context).attachInsuraceImage,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Divider(), 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( SizedBox(
height: 3, height: 3,
), ),
Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), Text(
TranslationBase.of(context).fileNo + " " + widget.fileNo,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.48,
),
),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
ImageOptions.showImageOptions(context, (String image,File file) { ImageOptions.showImageOptions(context, (String image, File file) {
setState(() { setState(() {
this.image = image; this.image = image;
this.file = file; this.file = file;
@ -61,14 +79,14 @@ class _AttachInsuranceCardImageDialogState
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
height: 250, height: 250,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), border: Border.all(color: Colors.grey, width: 1.5)),
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Colors.grey, width: 1.5)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment., // mainAxisAlignment: MainAxisAlignment.,
children: [ children: [
SizedBox(height: 25,), SizedBox(
height: 25,
),
Icon( Icon(
Icons.camera_enhance_rounded, Icons.camera_enhance_rounded,
size: 85, size: 85,
@ -77,7 +95,14 @@ class _AttachInsuranceCardImageDialogState
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon(Icons.attach_file), 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,
),
)
], ],
), ),
], ],
@ -106,8 +131,12 @@ class _AttachInsuranceCardImageDialogState
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
color: Colors.red, color: Colors.red,
), ),
), ),
@ -115,6 +144,7 @@ class _AttachInsuranceCardImageDialogState
), ),
), ),
), ),
),
Container( Container(
width: 1, width: 1,
height: 30, height: 30,
@ -130,9 +160,13 @@ class _AttachInsuranceCardImageDialogState
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
)), )),
), ),
), ),

@ -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/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -45,127 +47,147 @@ class _InsuranceCardState extends State<InsuranceCard> {
description: TranslationBase.of(context).infoInsuranceCards, description: TranslationBase.of(context).infoInsuranceCards,
infoList: TranslationBase.of(context).infoInsuranceCardsPoints, infoList: TranslationBase.of(context).infoInsuranceCardsPoints,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
appBarIcons: [ showNewAppBar: true,
IconButton( showNewAppBarTitle: true,
padding: EdgeInsets.zero, backgroundColor: CustomColors.appBackgroudGreyColor,
icon: Container( floatingActionButton: FloatingActionButton(
decoration: BoxDecoration( onPressed: () {
color: Colors.white, Navigator.push(context, FadePage(page: InsuranceUpdate()));
borderRadius: BorderRadius.circular(8), },
), backgroundColor: CustomColors.accentColor,
margin: EdgeInsets.only(right: 8), child: Padding(
padding: EdgeInsets.only(right: 4, left: 4), padding: const EdgeInsets.all(12.0),
child: Image.asset( child: Image.asset(
'assets/images/medical/insurance_update_icon_.png', 'assets/images/medical/insurance_update_icon_.png',
height: SizeConfig.heightMultiplier * 5, color: Colors.white,
width: SizeConfig.heightMultiplier * 5,
), ),
), ),
onPressed: () {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
), ),
],
body: Container( body: Container(
margin: EdgeInsets.only(left: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004, top: SizeConfig.screenWidth * 0.04), child: ListView.separated(
child: ListView.builder(
itemCount: model.insurance == null ? 0 : model.insurance.length, itemCount: model.insurance == null ? 0 : model.insurance.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return RoundedContainer( return Container(
backgroundColor: Colors.white, 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( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ExpansionTile(
title: Container(
height: 65.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Padding( Text(
padding: EdgeInsets.symmetric(vertical: 15.0),
child: Texts(
model.insurance[index].groupName, model.insurance[index].groupName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.64),
), ),
), mHeight(8),
], Text(
),
),
children: <Widget>[
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,
),
]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).companyName + model.insurance[index].companyName, TranslationBase.of(context).companyName + model.insurance[index].companyName,
fontSize: 20.0, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.48),
fontWeight: FontWeight.w700,
), ),
Divider( Divider(
thickness: 2,
color: Colors.black, color: Colors.black,
height: 25.0,
thickness: 0.5,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).category, fontSize: 18.5), Texts(model.insurance[index].subCategoryDesc, fontSize: 18.5)], 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)),
),
],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(TranslationBase.of(context).expirationDate, fontSize: 18.5), Text(
Texts( TranslationBase.of(context).expirationDate,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
convertDateFormat( convertDateFormat(
model.insurance[index].cardValidTo, model.insurance[index].cardValidTo,
), ),
fontSize: 18.5), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(TranslationBase.of(context).status + ": ", fontSize: 18.5), Text(
TranslationBase.of(context).status + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
model.insurance[index].isActive == true model.insurance[index].isActive == true
? Texts(TranslationBase.of(context).activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, fontSize: 17.9) ? Text(
: Texts(TranslationBase.of(context).notActive, color: Colors.red, fontWeight: FontWeight.w900, fontSize: 17.9) 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,
),
)
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).patientCard, fontSize: 18.5), Texts(model.insurance[index].patientCardID, fontSize: 18.5)], 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: [ Row(
Texts( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).policyNumber, TranslationBase.of(context).policyNumber,
fontSize: 18.5, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
), ),
Texts( Text(
model.insurance[index].insurancePolicyNumber, model.insurance[index].insurancePolicyNumber,
fontSize: 18.5, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
) )
]),
], ],
), ),
],
),
if (model.insurance[index].isActive == true)
SizedBox( SizedBox(
height: 14.5, height: 8.5,
), ),
if (model.insurance[index].isActive == true) if (model.insurance[index].isActive == true)
Container( Container(
color: Colors.transparent, color: Colors.transparent,
child: SecondaryButton( child: SecondaryButton(
onTap: () => {getDetails(model.insurance[index])}, onTap: () => {
getDetails(model.insurance[index]),
},
label: TranslationBase.of(context).seeDetails, label: TranslationBase.of(context).seeDetails,
textColor: Colors.white, textColor: Colors.white,
), ),
@ -174,13 +196,13 @@ class _InsuranceCardState extends State<InsuranceCard> {
], ],
), ),
), ),
],
),
],
),
), ),
); );
}), },
separatorBuilder: (BuildContext context, int index) {
return mHeight(8);
},
),
), ),
), ),
); );

@ -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/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -20,13 +22,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
final int patientID; final int patientID;
final String name; final String name;
const InsuranceCardUpdateDetails( const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name}) : super(key: key);
{Key key,
this.insuranceCardDetailsModel,
this.patientIdentificationID,
this.patientID,
this.name})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,21 +32,29 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).cardDetail, appBarTitle: TranslationBase.of(context).cardDetail,
body: SingleChildScrollView( showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
children: [ children: [
...List.generate( ListView.separated(
insuranceCardDetailsModel.length, physics: NeverScrollableScrollPhysics(),
(index) => Padding( shrinkWrap: true,
padding: const EdgeInsets.all(8.0), itemBuilder: (context, index) {
child: Container( return Container(
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.only(left: 8, right: 8, top: 8), // height: projectViewModel.isArabic ? 320 : 240,
height: projectViewModel.isArabic ? 320 : 240, // decoration: containerRadius(CustomColors.accentColor, 12),
decoration: BoxDecoration( child: Card(
borderRadius: BorderRadius.circular(25), shape: cardRadius(12),
color: Color(0xff515B5D), color: CustomColors.accentColor,
), elevation: 4,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
@ -58,23 +62,27 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
children: [ children: [
Text( Text(
insuranceCardDetailsModel[index].memberID, insuranceCardDetailsModel[index].memberID,
textScaleFactor: 2.1,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: 8.0, letterSpacing: -0.48,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
fontSize: 15), fontSize: 16,
),
), ),
SizedBox( SizedBox(
height: 5, height: 2,
), ),
Texts( Text(
insuranceCardDetailsModel[index].companyName, insuranceCardDetailsModel[index].companyName,
fontSize: 14, style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 14,
),
), ),
SizedBox( SizedBox(
height: 25, height: 14,
), ),
Row( Row(
children: [ children: [
@ -82,36 +90,52 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).policyHolder, TranslationBase.of(context).policyHolder,
style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14, letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
), ),
Texts( Text(
insuranceCardDetailsModel[index] insuranceCardDetailsModel[index].memberName,
.memberName, style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14, letterSpacing: -0.48,
fontSize: 12,
),
), ),
], ],
), ),
), ),
Expanded( Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).policyNo, Text(
color: Colors.white), TranslationBase.of(context).policyNo,
Texts( style: TextStyle(
insuranceCardDetailsModel[index] color: Colors.white,
.policyNumber, letterSpacing: -0.48,
color: Colors.white), fontWeight: FontWeight.w600,
], fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].policyNumber,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
), ),
), ),
], ],
), ),
],
),
SizedBox( SizedBox(
height: 25, height: 14,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -120,52 +144,69 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context) TranslationBase.of(context).expiryDateTitle,
.expiryDateTitle, style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
Texts( ),
insuranceCardDetailsModel[index].dOB, Text(
insuranceCardDetailsModel[index].effectiveTo,
style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontSize: 12, fontSize: 12,
), ),
),
], ],
), ),
), ),
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Texts( Text(
TranslationBase.of(context).classTitle, TranslationBase.of(context).classTitle,
style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
Texts( ),
insuranceCardDetailsModel[index] Text(
.subCategory, insuranceCardDetailsModel[index].subCategory,
style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontSize: 12, fontSize: 12,
), ),
),
], ],
), ),
), ),
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Texts( Text(
TranslationBase.of(context).approval, TranslationBase.of(context).approval,
style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
Texts( ),
insuranceCardDetailsModel[index] Text(
.approvalLimit insuranceCardDetailsModel[index].approvalLimit.toString(),
.toString(), style: TextStyle(
color: Colors.white, color: Colors.white,
letterSpacing: -0.48,
fontSize: 12, fontSize: 12,
), ),
),
], ],
), ),
), ),
@ -175,61 +216,49 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
), ),
), ),
), ),
);
},
separatorBuilder: (context, index) {
return mHeight(12);
},
itemCount: insuranceCardDetailsModel.length,
), ),
), if (insuranceCardDetailsModel.isEmpty)
if(insuranceCardDetailsModel.isEmpty)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(10.0),
child: Card( child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: cardRadius(12),
borderRadius:
BorderRadius.circular(10),
),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
top: 2.0,
left: 10.0,
right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Texts( Text(
name, name,
style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.black, fontWeight: FontWeight.w600,
fontWeight: letterSpacing: -0.46,
FontWeight.w500,
), ),
SizedBox(
height: 8,
), ),
Texts( Text(
TranslationBase.of( TranslationBase.of(context).fileno + ": " + patientID.toString(),
context) style: TextStyle(
.fileno + fontSize: 12,
": " +patientID.toString(), fontWeight: FontWeight.w600,
fontSize: 14, letterSpacing: -0.46,
color: Colors.black, ),
fontWeight:
FontWeight.w500,
) )
], ],
), ),
@ -240,86 +269,138 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
), ),
), ),
), ),
SizedBox(height: 150,), SizedBox(
Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), height: 150,
SizedBox(height: 8,), ),
Texts(TranslationBase.of(context).noDataAvailable) 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,
),
)
], ],
) )
], ],
), ),
), ),
bottomSheet: Container( ),
width: double.infinity, ),
height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, Padding(
child: Container( padding: const EdgeInsets.all(12.0),
margin: EdgeInsets.only(left: 8, right: 8),
child: Column( child: Column(
children: [ children: [
SizedBox( if (insuranceCardDetailsModel.isEmpty)
height: 8,
),
if(insuranceCardDetailsModel.isEmpty)
SecondaryButton( SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).scanNow.toUpperCase(), label: TranslationBase.of(context).scanNow.toUpperCase(),
color: Theme.of(context).primaryColor, color: CustomColors.accentColor,
small: true, small: true,
onTap: () async { onTap: () async {
confirmAttachInsuranceCardImageDialogDialog( confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
context: context,
name: name,
fileNo: patientID.toString(),
model: model);
}, },
), ),
if(insuranceCardDetailsModel.isNotEmpty) if (insuranceCardDetailsModel.isNotEmpty)
SecondaryButton( SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).agree.toUpperCase(), label: TranslationBase.of(context).agree.toUpperCase(),
color: Theme.of(context).primaryColor, color: CustomColors.accentColor,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard( await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID);
patientIdentificationID: patientIdentificationID,
patientID: patientID);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
message: TranslationBase.of(context).requestSent);
} }
}, },
),if(insuranceCardDetailsModel.isNotEmpty) ),
if (insuranceCardDetailsModel.isNotEmpty)
SizedBox( SizedBox(
height: 12, height: 12,
),if(insuranceCardDetailsModel.isNotEmpty) ),
if (insuranceCardDetailsModel.isNotEmpty)
SecondaryButton( SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).disagree.toUpperCase(), label: TranslationBase.of(context).disagree.toUpperCase(),
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
confirmAttachInsuranceCardImageDialogDialog( confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
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( void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) {
{BuildContext context,
String name,
String fileNo,
InsuranceViewModel model}) {
showDialog( showDialog(
context: context, context: context,
child: AttachInsuranceCardImageDialog( child: AttachInsuranceCardImageDialog(
@ -327,17 +408,12 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
name: name, name: name,
image: (file, image) async { image: (file, image) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard( await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID, image: image);
patientIdentificationID: patientIdentificationID,
patientID: patientID,
image: image);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) {
model.state == ViewState.Error) {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
message: TranslationBase.of(context).requestSent);
} }
Navigator.pop(context); Navigator.pop(context);
}, },

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
@ -17,6 +18,9 @@ class InsuranceCardDetails extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).cardDetail, appBarTitle: TranslationBase.of(context).cardDetail,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Center( body: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Html( child: Html(

@ -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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -17,223 +18,137 @@ class InsurancePage extends StatelessWidget {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>(); InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key); InsurancePage({Key key, this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
children: [ children: [
SizedBox(
height: 65,
),
Container( Container(
margin: EdgeInsets.all(10.0), width: double.infinity,
color: Colors.white, child: Card(
width: MediaQuery.of(context).size.width, shape: cardRadius(12),
padding: EdgeInsets.all(10.0), 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( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
if (model.user != null) if (model.user != null)
Expanded( Expanded(
flex: 3,
child: Container(
margin:
EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Text(
model.user.firstName + " " + model.user.lastName, model.user.firstName + " " + model.user.lastName,
style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.black, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500, letterSpacing: -0.46,
), ),
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(
children: <Widget>[
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);
},
), ),
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),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0, left: 10.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
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( if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
flex: 2, ListView.separated(
child: Container( physics: NeverScrollableScrollPhysics(),
margin: EdgeInsets.only(top: 2.0), shrinkWrap: true,
child: Column( itemBuilder: (context, index) {
children: <Widget>[ return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
Container( ? InkWell(
child: SecondaryButton(
label: TranslationBase.of(context)
.fetchData,
small: true,
textColor: Colors.white,
onTap: () { onTap: () {
getDetails( getDetails(
projectID: 15, projectID: 15,
patientIdentificationID: model patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientIdenficationNumber,
setupID: '010266', setupID: '010266',
patientID: model patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
.getAllSharedRecordsByStatusResponse name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
.getAllSharedRecordsByStatusList[
index]
.responseID,
name: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
context: context); context: context);
}, },
child: Container(
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( getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, BuildContext context}) {
{String setupID,
int projectID,
String patientIdentificationID,
int patientID,
String name,
BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID).then((value) {
.getPatientInsuranceDetails(
setupID: setupID,
projectID: projectID,
patientID: patientID,
patientIdentificationID: patientIdentificationID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (!_insuranceCardService.hasError && if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
_insuranceCardService.isHaveInsuranceCard) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: InsuranceCardUpdateDetails( page: InsuranceCardUpdateDetails(
insuranceCardDetailsModel: insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
_insuranceCardService.insuranceCardDetailsList,
patientID: patientID, patientID: patientID,
patientIdentificationID: patientIdentificationID, patientIdentificationID: patientIdentificationID,
name: name, name: name,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -23,20 +24,17 @@ class InsuranceUpdate extends StatefulWidget {
_InsuranceUpdateState createState() => _InsuranceUpdateState(); _InsuranceUpdateState createState() => _InsuranceUpdateState();
} }
class _InsuranceUpdateState extends State<InsuranceUpdate> class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 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'));
'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() { void dispose() {
@ -47,8 +45,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(), onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
AppScaffold(
appBarTitle: TranslationBase.of(context).insurCards, appBarTitle: TranslationBase.of(context).insurCards,
description: TranslationBase.of(context).infoInsurCards, description: TranslationBase.of(context).infoInsurCards,
infoList: TranslationBase.of(context).infoPrescriptionsPoints, infoList: TranslationBase.of(context).infoPrescriptionsPoints,
@ -56,60 +53,49 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: true, isShowDecPage: true,
baseViewModel: model, baseViewModel: model,
body: Scaffold( showNewAppBarTitle: true,
extendBodyBehindAppBar: true, showNewAppBar: true,
appBar: PreferredSize( backgroundColor: CustomColors.appBackgroudGreyColor,
preferredSize: Size.fromHeight(70.0), body: Column(
child: Stack(
children: <Widget>[ children: <Widget>[
Center( Container(
child: Container( height: 45,
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,
),
),
color: Colors.white,
),
child: Center(
child: TabBar( child: TabBar(
controller: _tabController, controller: _tabController,
isScrollable: true, isScrollable: false,
indicatorWeight: 4.0, indicatorWeight: 3.0,
indicatorColor: Theme.of(context).primaryColor, indicatorColor: CustomColors.accentColor,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.symmetric( labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey, unselectedLabelColor: Colors.grey,
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: Texts(TranslationBase.of(context) child: Text(
.updateInsuranceSubtitle), TranslationBase.of(context).updateInsuranceSubtitle,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center( 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: <Widget>[
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -117,18 +103,17 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
children: <Widget>[ children: <Widget>[
InsurancePage(model: model), InsurancePage(model: model),
Container( Container(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: ListView.builder( child: ListView.builder(
itemCount: model.insuranceUpdate == null itemCount: model.insuranceUpdate == null ? 0 : model.insuranceUpdate.length,
? 0
: model.insuranceUpdate.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
margin: EdgeInsets.all(10.0),
child: Card( child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white, color: Colors.white,
elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(12),
), ),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -143,47 +128,37 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
Expanded( Expanded(
flex: 3, flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
top: 2.0,
left: 10.0,
right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Text(
model.user.firstName + model.user.firstName + " " + model.user.lastName,
" " + style: TextStyle(
model.user.lastName,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
color: Colors.black, letterSpacing: -0.46,
),
), ),
SizedBox( SizedBox(
height: 8, height: 4,
), ),
Texts( Text(
TranslationBase.of(context) TranslationBase.of(context).fileno + ": " + model.insuranceUpdate[index].patientID.toString(),
.fileno + style: TextStyle(
": " +
model
.insuranceUpdate[
index]
.patientID
.toString(),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
color: Colors.black, letterSpacing: -0.46,
), ),
SizedBox(
height: 8,
), ),
Texts(
model.insuranceUpdate[index] Text(
.createdOn, model.insuranceUpdate[index].createdOn,
style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
color: Colors.black, letterSpacing: -0.46,
),
), ),
], ],
), ),
@ -195,19 +170,16 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset("assets/images/new-design/confirm_button.png", width: 30.0, height: 30.0),
"assets/images/new-design/confirm_button.png",
width: 30.0,
height: 30.0),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 6.5, left: 2.0),
top: 13.5, left: 2.0), child: Text(
child: Texts( model.insuranceUpdate[index].statusDescription,
model.insuranceUpdate[index] style: TextStyle(
.statusDescription, fontSize: 10,
textAlign: TextAlign.center, fontWeight: FontWeight.w600,
fontSize: 12, letterSpacing: -0.46,
color: Colors.black, ),
), ),
), ),
], ],
@ -223,12 +195,12 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
); );
}), }),
), ),
),
], ],
)) ))
], ],
), ),
), ),
),
); );
} }
} }

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -57,10 +58,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
super.initState(); super.initState();
getAuthUser(); getAuthUser();
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png',
'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'));
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png'));
} }
@override @override
@ -72,6 +71,9 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
appBarTitle: TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).advancePayment,
description: TranslationBase.of(context).infoAdvancePayment, description: TranslationBase.of(context).infoAdvancePayment,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -79,9 +81,14 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).advancePaymentLabel, TranslationBase.of(context).advancePaymentLabel,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -89,16 +96,21 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
InkWell( InkWell(
onTap: () => confirmSelectBeneficiaryDialog(model), onTap: () => confirmSelectBeneficiaryDialog(model),
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getBeneficiaryType()), Text(
getBeneficiaryType(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down) Icon(Icons.arrow_drop_down)
], ],
), ),
@ -114,23 +126,26 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.getFamilyFiles().then((value) { model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList);
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList);
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getFamilyMembersName()), Text(
Icon(Icons.arrow_drop_down) getFamilyMembersName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -151,29 +166,30 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onTap: () { onTap: () {
if (_fileTextController.text.isNotEmpty) { if (_fileTextController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) {
.getPatientInfoByPatientID(
id: _fileTextController.text)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
confirmSelectPatientDialog(model.patientInfoList); confirmSelectPatientDialog(model.patientInfoList);
}); });
} else } else
AppToast.showErrorToast( AppToast.showErrorToast(message: 'Please Enter The File Number');
message: 'Please Enter The File Number');
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getPatientName()), Text(
Icon(Icons.arrow_drop_down) getPatientName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -187,14 +203,19 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName()), Text(
Icon(Icons.arrow_drop_down) getHospitalName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -237,15 +258,15 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: 90, height: 70,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(18), padding: EdgeInsets.all(12),
color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,
disabled: amount.isEmpty || color: CustomColors.accentColor,
_fileTextController.text.isEmpty || disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null,
_selectedHospital == null,
onTap: () { onTap: () {
var mobileNum; var mobileNum;
var patientName; var patientName;
@ -273,15 +294,11 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
advanceModel.mobileNumber = mobileNum; advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName; advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
.getPatientInfoByPatientIDAndMobileNumber(advanceModel)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error && if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
model.state != ViewState.ErrorLocal) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
Navigator.push(context, FadePage(page: PaymentMethod())) Navigator.push(context, FadePage(page: PaymentMethod())).then(
.then(
(value) { (value) {
Navigator.push( Navigator.push(
context, context,
@ -289,8 +306,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
page: ConfirmPaymentPage( page: ConfirmPaymentPage(
advanceModel: advanceModel, advanceModel: advanceModel,
selectedPaymentMethod: value, selectedPaymentMethod: value,
patientInfoAndMobileNumber: patientInfoAndMobileNumber: model.patientInfoAndMobileNumber,
model.patientInfoAndMobileNumber,
authenticatedUser: authUser, authenticatedUser: authUser,
), ),
), ),
@ -314,8 +330,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
setState(() { setState(() {
if (value == BeneficiaryType.MyAccount) { if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString(); _fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
model.user.firstName + " " + model.user.lastName;
} else } else
_fileTextController.text = ""; _fileTextController.text = "";
@ -357,8 +372,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
); );
} }
void confirmSelectFamilyDialog( void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
if (getAllSharedRecordsByStatusList.isNotEmpty) if (getAllSharedRecordsByStatusList.isNotEmpty)
showDialog( showDialog(
context: context, context: context,
@ -368,8 +382,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
selectedPatientFamily = value; selectedPatientFamily = value;
_fileTextController.text = _fileTextController.text = selectedPatientFamily.responseID.toString();
selectedPatientFamily.responseID.toString();
advanceModel.depositorName = value.patientName; advanceModel.depositorName = value.patientName;
}); });
}, },
@ -409,8 +422,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -32,11 +33,7 @@ class ConfirmPaymentPage extends StatelessWidget {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
ConfirmPaymentPage( ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
{this.advanceModel,
this.patientInfoAndMobileNumber,
this.selectedPaymentMethod,
this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,11 +48,9 @@ class ConfirmPaymentPage extends StatelessWidget {
print("dialog dismissed"); print("dialog dismissed");
print(value); print(value);
if (value != null && value) { if (value != null && value) {
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID; appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser, openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null);
double.parse(advanceModel.amount), null);
} }
}); });
} }
@ -64,6 +59,9 @@ class ConfirmPaymentPage extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).advancePayment,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -71,11 +69,14 @@ class ConfirmPaymentPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).confirmThePayment, TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontWeight: FontWeight.w500, style: TextStyle(
fontSize: 24, fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -89,10 +90,13 @@ class ConfirmPaymentPage extends StatelessWidget {
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(getImagePath(selectedPaymentMethod)), child: Image.asset(getImagePath(selectedPaymentMethod)),
), ),
Texts( Text(
'${advanceModel.amount} SAR', '${advanceModel.amount} SAR',
fontSize: 26, style: TextStyle(
bold: true, fontSize: 20,
fontWeight: FontWeight.w900,
letterSpacing: -0.48,
),
) )
], ],
), ),
@ -136,11 +140,7 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorName, hintText: TranslationBase.of(context).depositorName,
initialValue: model.user.firstName + initialValue: model.user.firstName + " " + model.user.middleName + " " + model.user.lastName,
" " +
model.user.middleName +
" " +
model.user.lastName,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -156,29 +156,27 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, color: Colors.white,
child: Container(
height: MediaQuery.of(context).size.width * 0.18,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: Theme.of(context).primaryColor, color: CustomColors.accentColor,
label: TranslationBase.of(context).confirm.toUpperCase(), label: TranslationBase.of(context).confirm.toUpperCase(),
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onTap: () { onTap: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) {
.sendActivationCodeForAdvancePayment(
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog();
model.state != ViewState.Error) showSMSDialog();
}); });
}, },
), ),
), ),
), ),
),
); );
} }
@ -204,29 +202,13 @@ class ConfirmPaymentPage extends StatelessWidget {
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
double amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID( transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
browser.openPaymentBrowser( browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType,
amount, advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false);
"Advance Payment",
transID,
advanceModel.hospitalsModel.iD.toString(),
advanceModel.email,
paymentMethod,
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
authenticatedUser,
browser,
false);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -278,23 +260,11 @@ class ConfirmPaymentPage extends StatelessWidget {
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.HIS_createAdvancePayment( service.HIS_createAdvancePayment(appo, advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], patientInfoAndMobileNumber.patientType,
appo, advanceModel.patientName, advanceModel.fileNumber, AppGlobal.context)
advanceModel.hospitalsModel.iD.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo);
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
0,
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -302,13 +272,9 @@ class ConfirmPaymentPage extends StatelessWidget {
}); });
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) {
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
navigateToHome(AppGlobal.context); navigateToHome(AppGlobal.context);

@ -10,12 +10,10 @@ class SelectBeneficiaryDialog extends StatefulWidget {
final BeneficiaryType beneficiaryType; final BeneficiaryType beneficiaryType;
final Function(BeneficiaryType) onValueSelected; final Function(BeneficiaryType) onValueSelected;
SelectBeneficiaryDialog( SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected});
{Key key, this.beneficiaryType, this.onValueSelected});
@override @override
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType);
_SelectBeneficiaryDialogState(this.beneficiaryType);
} }
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> { class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
@ -42,7 +40,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: BeneficiaryType.MyAccount, value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -72,7 +77,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: BeneficiaryType.MyFamilyFiles, value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -102,7 +114,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: BeneficiaryType.OtherAccount, value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -134,8 +153,12 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red, color: Colors.red,
), ),
), ),
@ -143,6 +166,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
), ),
), ),
), ),
),
Container( Container(
width: 1, width: 1,
height: 30, height: 30,
@ -158,9 +182,13 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
), ),
), ),

@ -11,8 +11,7 @@ class SelectHospitalDialog extends StatefulWidget {
final Function(HospitalsModel) onValueSelected; final Function(HospitalsModel) onValueSelected;
HospitalsModel selectedHospital; HospitalsModel selectedHospital;
SelectHospitalDialog( SelectHospitalDialog({Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override @override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState(); _SelectHospitalDialogState createState() => _SelectHospitalDialogState();
@ -51,8 +50,14 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.hospitals[index].name + title: Text(
' ${widget.hospitals[index].distanceInKilometers} KM'), widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
@ -90,9 +95,14 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), 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<SelectHospitalDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -11,18 +11,17 @@ class SelectPatientFamilyDialog extends StatefulWidget {
final Function(GetAllSharedRecordsByStatusList) onValueSelected; final Function(GetAllSharedRecordsByStatusList) onValueSelected;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily});
@override @override
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
} }
class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> { class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0];
} }
@override @override
@ -51,7 +50,14 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: widget.getAllSharedRecordsByStatusList[index], value: widget.getAllSharedRecordsByStatusList[index],
groupValue: widget.selectedPatientFamily, groupValue: widget.selectedPatientFamily,
@ -89,8 +95,12 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red, color: Colors.red,
), ),
), ),
@ -98,6 +108,7 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
), ),
), ),
), ),
),
Container( Container(
width: 1, width: 1,
height: 30, height: 30,
@ -113,10 +124,15 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -9,22 +9,22 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart'; import '../../../../Constants.dart';
class SelectPatientInfoDialog extends StatefulWidget { class SelectPatientInfoDialog extends StatefulWidget {
final List<PatientInfo> patientInfoList ; final List<PatientInfo> patientInfoList;
final Function(PatientInfo) onValueSelected; final Function(PatientInfo) onValueSelected;
PatientInfo selectedPatientInfo; PatientInfo selectedPatientInfo;
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo});
@override @override
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
} }
class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> { class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0];
} }
@override @override
@ -53,7 +53,14 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: widget.patientInfoList[index], value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo, groupValue: widget.selectedPatientInfo,
@ -91,8 +98,12 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red, color: Colors.red,
), ),
), ),
@ -100,6 +111,7 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
), ),
), ),
), ),
),
Container( Container(
width: 1, width: 1,
height: 30, height: 30,
@ -115,10 +127,15 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -17,10 +18,7 @@ class MyBalancePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 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'));
'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<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), onModelReady: (model) => model.getPatientAdvanceBalanceAmount(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -29,16 +27,22 @@ class MyBalancePage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).myBalances, appBarTitle: TranslationBase.of(context).myBalances,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance, description: TranslationBase.of(context).infoMyBalance,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).balanceAmount, TranslationBase.of(context).balanceAmount,
color: Colors.black, style: TextStyle(
bold: true, fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
SizedBox( SizedBox(
height: 15, height: 15,
@ -55,16 +59,23 @@ class MyBalancePage extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Text(
'${model.totalAdvanceBalanceAmount ?? 0} ' + '${model.totalAdvanceBalanceAmount ?? 0} ' + TranslationBase.of(context).sar,
TranslationBase.of(context).sar, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.white, color: Colors.white,
bold: true,
), ),
Texts( ),
Text(
TranslationBase.of(context).totalBalance, TranslationBase.of(context).totalBalance,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.46,
color: Colors.white, color: Colors.white,
), ),
),
], ],
), ),
), ),
@ -80,18 +91,26 @@ class MyBalancePage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(12),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Text(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + TranslationBase.of(context).sar,
TranslationBase.of(context).sar, style: TextStyle(
bold: true, 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), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: CustomColors.accentColor,
label: TranslationBase.of(context).createAdvancedPayment, label: TranslationBase.of(context).createAdvancedPayment,
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));

@ -70,8 +70,8 @@ class NewTextFields extends StatefulWidget {
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 14.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w600,
this.autoValidate = false, this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true,this.counterText=""}) this.isEnabled = true,this.counterText=""})

@ -242,10 +242,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 14.0, fontSize: widget.small ? 12.0 : 14.0,
// fontWeight: FontWeight.w800, fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ),
? 'Cairo'
: 'WorkSans'),
), ),
) )
], ],

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
/// [page] /// [page]
class FadePage extends PageRouteBuilder { class FadePage extends PageRouteBuilder {
final Widget page; final Widget page;
FadePage({this.page}) FadePage({this.page})
: super( : super(
opaque: false, opaque: false,
@ -23,10 +24,7 @@ class FadePage extends PageRouteBuilder {
Animation<double> secondaryAnimation, Animation<double> secondaryAnimation,
Widget child, Widget child,
) { ) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation, },
child: child
);
}
); );
} }
Loading…
Cancel
Save