InPatient pending advance payment done
parent
4afdf5545e
commit
dd79b1dfca
@ -0,0 +1,71 @@
|
|||||||
|
class InPatientAdvanceResponseModel {
|
||||||
|
int advanceNumber;
|
||||||
|
Null errorCode;
|
||||||
|
String message;
|
||||||
|
List<ResponseInpatientAdvanceInfo> responseInpatientAdvanceInfo;
|
||||||
|
int statusCode;
|
||||||
|
|
||||||
|
InPatientAdvanceResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
|
||||||
|
|
||||||
|
InPatientAdvanceResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
advanceNumber = json['advanceNumber'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
message = json['message'];
|
||||||
|
if (json['responseInpatientAdvanceInfo'] != null) {
|
||||||
|
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
|
||||||
|
json['responseInpatientAdvanceInfo'].forEach((v) {
|
||||||
|
responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
statusCode = json['statusCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['advanceNumber'] = this.advanceNumber;
|
||||||
|
data['errorCode'] = this.errorCode;
|
||||||
|
data['message'] = this.message;
|
||||||
|
if (this.responseInpatientAdvanceInfo != null) {
|
||||||
|
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['statusCode'] = this.statusCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ResponseInpatientAdvanceInfo {
|
||||||
|
int admissionNo;
|
||||||
|
int admissionReqNo;
|
||||||
|
String createdOn;
|
||||||
|
int patientId;
|
||||||
|
int projectId;
|
||||||
|
int requestedAmount;
|
||||||
|
String setupId;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status});
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
admissionNo = json['admissionNo'];
|
||||||
|
admissionReqNo = json['admissionReqNo'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
projectId = json['projectId'];
|
||||||
|
requestedAmount = json['requestedAmount'];
|
||||||
|
setupId = json['setupId'];
|
||||||
|
status = json['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['admissionNo'] = this.admissionNo;
|
||||||
|
data['admissionReqNo'] = this.admissionReqNo;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['projectId'] = this.projectId;
|
||||||
|
data['requestedAmount'] = this.requestedAmount;
|
||||||
|
data['setupId'] = this.setupId;
|
||||||
|
data['status'] = this.status;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,15 +1,223 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class InPatientPendingAdvancePayment extends StatefulWidget {
|
class InPatientPendingAdvancePayment extends StatefulWidget {
|
||||||
const InPatientPendingAdvancePayment({Key key}) : super(key: key);
|
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
|
||||||
|
|
||||||
|
InPatientPendingAdvancePayment({@required this.inPatientAdvanceResponseModel});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState();
|
State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvancePayment> {
|
class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvancePayment> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
InAppBrowser browser = new InAppBrowser();
|
||||||
|
|
||||||
|
var _InAppBrowserOptions = InAppBrowserClassOptions(
|
||||||
|
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
|
||||||
|
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false),
|
||||||
|
ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)),
|
||||||
|
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
|
||||||
|
android: AndroidInAppBrowserOptions(),
|
||||||
|
ios:
|
||||||
|
IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
browser = new InAppBrowser();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container();
|
projectViewModel = Provider.of(context);
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Container(
|
||||||
|
decoration: cardRadius(12),
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Payment request for: ",
|
||||||
|
// TranslationBase.of(context).covidBookAppo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(6),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).patientName + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).identificationNumber + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.patientIdentificationNo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).mrn + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.patientID.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(12),
|
||||||
|
// Expanded(child: Container()),
|
||||||
|
Container(
|
||||||
|
decoration: cardRadius(12.0),
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
padding: EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).patientShareTotalToDo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).sar + " ${widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].requestedAmount}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 24,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.75,
|
||||||
|
child: getPaymentMethods(),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).payNow.toUpperCase(),
|
||||||
|
() {
|
||||||
|
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse("https://google.com/")), options: _InAppBrowserOptions);
|
||||||
|
},
|
||||||
|
// : null,
|
||||||
|
color: CustomColors.green,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).copyLinkTxt,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).copyLink.toUpperCase(),
|
||||||
|
() {
|
||||||
|
Clipboard.setData(const ClipboardData(text: "https://google.com/")).then((_) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(TranslationBase.of(context).paymentLinkCopied)));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
svgIcon: "assets/images/new/copy.svg",
|
||||||
|
color: CustomColors.accentColor,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue