merge-update-with-lab-changes
haroon amjad 2 years ago
parent 0f4f98f31c
commit c5e88ac7ba

@ -34,7 +34,7 @@ class _InPatientPaidAdvancePaymentState extends State<InPatientPaidAdvancePaymen
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Padding( return Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: inPatientAdvanceHistoryResponseModel != null && inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo.isNotEmpty child: inPatientAdvanceHistoryResponseModel != null && inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo != null
? ListView.separated( ? ListView.separated(
itemCount: inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo.length, itemCount: inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {

@ -16,8 +16,9 @@ import 'package:share_plus/share_plus.dart';
class InPatientPendingAdvancePayment extends StatefulWidget { class InPatientPendingAdvancePayment extends StatefulWidget {
InPatientAdvanceResponseModel inPatientAdvanceResponseModel; InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isHasData;
InPatientPendingAdvancePayment({@required this.inPatientAdvanceResponseModel}); InPatientPendingAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
@override @override
State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState(); State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState();
@ -57,7 +58,8 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Column( child: widget.isHasData
? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
@ -137,13 +139,14 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
], ],
), ),
], ],
), )
: getNoDataWidget(context),
), ),
), ),
), ),
mHeight(12), mHeight(12),
// Expanded(child: Container()), // Expanded(child: Container()),
Container( widget.isHasData ? Container(
decoration: cardRadius(12.0), decoration: cardRadius(12.0),
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
@ -218,7 +221,7 @@ class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvance
), ),
], ],
), ),
), ) : Container(),
], ],
), ),
); );

@ -2,9 +2,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart'; import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_paid_advance_payment.dart'; import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_paid_advance_payment.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_pending_advance_payment.dart'; import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_pending_advance_payment.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/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';
@ -12,8 +9,9 @@ import 'package:provider/provider.dart';
class InPatientAdvancePayment extends StatefulWidget { class InPatientAdvancePayment extends StatefulWidget {
InPatientAdvanceResponseModel inPatientAdvanceResponseModel; InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isHasData;
InPatientAdvancePayment({@required this.inPatientAdvanceResponseModel}); InPatientAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
@override @override
State<InPatientAdvancePayment> createState() => _InPatientAdvancePaymentState(); State<InPatientAdvancePayment> createState() => _InPatientAdvancePaymentState();
@ -67,7 +65,7 @@ class _InPatientAdvancePaymentState extends State<InPatientAdvancePayment> with
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [ children: [
InPatientPendingAdvancePayment(inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel), InPatientPendingAdvancePayment(isHasData: widget.isHasData, inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel),
InPatientPaidAdvancePayment(), InPatientPaidAdvancePayment(),
], ],
), ),

@ -336,12 +336,14 @@ class _InPatientServicesHomeState extends State<InPatientServicesHome> {
if (res["MessageStatus"] == 1) { if (res["MessageStatus"] == 1) {
if (res['responseInpatient'] != null) { if (res['responseInpatient'] != null) {
inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]); inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]);
Navigator.push(context, FadePage(page: InPatientAdvancePayment(inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: true, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
} else { } else {
// Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: false, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
AppToast.showErrorToast(message: TranslationBase.of(context).noData); AppToast.showErrorToast(message: TranslationBase.of(context).noData);
} }
} else { } else {
AppToast.showErrorToast(message: res["endUserMessage"]); // AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: false, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -636,8 +636,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result),
projectViewModel.analytics.loginRegistration.login_successful(), projectViewModel.analytics.loginRegistration.login_successful(),
checkIfUserAgreedBefore(result),
} }
} }
else else
@ -668,7 +668,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (result.isNeedUserAgreement == true) { if (result.isNeedUserAgreement == true) {
//move to agreement page. //move to agreement page.
} else { } else {
checkIfIsInPatient();
goToHome(); goToHome();
} }
} }
@ -736,6 +735,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
checkIfIsInPatient(),
GifLoaderDialogUtils.hideDialog(AppGlobal.context), GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {

Loading…
Cancel
Save