master_new_changes
Aamir 1 year ago
parent 8d9c4091fb
commit 327f9d41b7

@ -21,14 +21,16 @@ class Document {
int? messageStatus; int? messageStatus;
String? message; String? message;
factory Document.fromJson(Map<String, dynamic> json) => Document( factory Document.fromJson(Map<String, dynamic> json) =>
Document(
totalItemsCount: json["totalItemsCount"], totalItemsCount: json["totalItemsCount"],
data: json["data"] == null ? null : List<DocumentData>.from(json["data"].map((x) => DocumentData.fromJson(x))), data: json["data"] == null ? null : List<DocumentData>.from(json["data"].map((x) => DocumentData.fromJson(x))),
messageStatus: json["messageStatus"], messageStatus: json["messageStatus"],
message: json["message"], message: json["message"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() =>
{
"totalItemsCount": totalItemsCount, "totalItemsCount": totalItemsCount,
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())), "data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
"messageStatus": messageStatus, "messageStatus": messageStatus,
@ -50,6 +52,7 @@ class DocumentData {
this.fileExt, this.fileExt,
this.documentName, this.documentName,
this.isLocalFile, this.isLocalFile,
this.description,
}); });
int? id; int? id;
@ -64,22 +67,26 @@ class DocumentData {
String? statusText; String? statusText;
String? documentName; String? documentName;
bool? isLocalFile; bool? isLocalFile;
String? description;
factory DocumentData.fromJson(Map<String, dynamic> json) => DocumentData( factory DocumentData.fromJson(Map<String, dynamic> json) =>
id: json["id"], DocumentData(
serviceProviderId: json["serviceProviderID"], id: json["id"],
documentId: json["documentID"], serviceProviderId: json["serviceProviderID"],
documentUrl: json["documentURL"], documentId: json["documentID"],
status: json["status"], documentUrl: json["documentURL"],
statusText: json["statusText"], status: json["status"],
comment: json["comment"], statusText: json["statusText"],
isActive: json["isActive"], comment: json["comment"],
document: null, isActive: json["isActive"],
fileExt: null, document: null,
documentName: json["documentName"], fileExt: null,
isLocalFile: false); documentName: json["documentName"],
isLocalFile: false,
description: null);
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() =>
{
"id": id, "id": id,
"serviceProviderID": serviceProviderId, "serviceProviderID": serviceProviderId,
"documentID": documentId, "documentID": documentId,

@ -27,10 +27,12 @@ abstract class PaymentService {
class PaymentServiceImp implements PaymentService { class PaymentServiceImp implements PaymentService {
MyInAppBrowser? myInAppBrowser; MyInAppBrowser? myInAppBrowser;
var inAppBrowserOptions = InAppBrowserClassOptions( var inAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false), ios: IOSInAppWebViewOptions(applePayAPIEnabled: true)), inAppWebViewGroupOptions:
InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false), ios: IOSInAppWebViewOptions(applePayAPIEnabled: true)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
android: AndroidInAppBrowserOptions(), android: AndroidInAppBrowserOptions(),
ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); ios:
IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
String getUrlRequestByPaymentId({required int id, List<int>? appointmentIds, required PaymentTypes paymentType}) { String getUrlRequestByPaymentId({required int id, List<int>? appointmentIds, required PaymentTypes paymentType}) {
String urlRequest = ""; String urlRequest = "";
@ -87,7 +89,7 @@ class PaymentServiceImp implements PaymentService {
onBrowserLoadStart(onFailure: onFailure, onSuccess: onSuccess, url: url); onBrowserLoadStart(onFailure: onFailure, onSuccess: onSuccess, url: url);
}); });
await myInAppBrowser!.openUrlRequest( await myInAppBrowser!.openUrlRequest(
urlRequest: URLRequest(url: Uri.parse(urlRequest)), urlRequest: URLRequest(url: WebUri(urlRequest, forceToStringRawValue: true)),
options: inAppBrowserOptions, options: inAppBrowserOptions,
); );
} }

@ -130,72 +130,77 @@ class _ProviderLicensePageState extends State<ProviderLicensePage> {
return serviceVM.document!.data!.isEmpty return serviceVM.document!.data!.isEmpty
? Text(LocaleKeys.somethingWrong.tr()) ? Text(LocaleKeys.somethingWrong.tr())
: ListView.separated( : ListView.separated(
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return 20.height; return 20.height;
}, },
itemCount: serviceVM.document!.data!.length, itemCount: serviceVM.document!.data!.length,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
itemBuilder: (context, index) { itemBuilder: (context, index) {
DocumentData? document = serviceVM.document?.data![index]; DocumentData? document = serviceVM.document?.data![index];
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
10.height, 10.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
(document!.documentName!).toText(fontSize: 16, letterSpacing: -0.56, fontWeight: MyFonts.SemiBold), (document!.documentName!).toText(fontSize: 16, letterSpacing: -0.56, fontWeight: MyFonts.SemiBold),
if (document.statusText != null && document.statusText!.isNotEmpty) ...[ if (document.statusText != null && document.statusText!.isNotEmpty) ...[
10.width, 10.width,
Utils.statusContainerChip(text: document.statusText!.replaceFirst('OrActive', ''), chipColor: getColorByStatus(document.status ?? 1)), Utils.statusContainerChip(text: document.statusText!.replaceFirst('OrActive', ''), chipColor: getColorByStatus(document.status ?? 1)),
],
],
),
if (document.status != 1 && document.status != 3) ...[
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 8),
child: LocaleKeys.enter_licence_detail.tr().toText(fontSize: 14, color: MyColors.lightTextColor),
),
TxtField(
hint: LocaleKeys.description.tr(),
maxLines: 3,
isBackgroundEnabled: true,
),
],
10.height,
if (isNeedToShow(model: serviceVM, document: document)) ...[
PickedFilesContainer(
isReview: document.status == 4,
allowAdButton: false,
pickedFiles: isLocalOrNetworkFiles(model: serviceVM, document: document),
onCrossPressedPrimary: isNetworkImage(document: document)
? serviceVM.removeNetworkImage
: document.documentId == 1
? serviceVM.commerceRemove
: document.documentId == 2
? serviceVM.commercialRemove
: serviceVM.vatRemove,
isPdf: serviceVM.document!.data![index].fileExt == "pdf",
isFromNetwork: !(document.isLocalFile ?? false),
onAddFilePressed: () {
serviceVM.pickPdfReceiptFile(context, document.documentId!, index);
},
),
buildCommentContainer(document: document),
] else ...[
10.height,
DottedRectContainer(
onTap: () => serviceVM.pickPdfReceiptFile(context, document.documentId!, index) ?? "",
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
),
],
], ],
); ],
}, ),
); if (document.status != 1 && document.status != 3) ...[
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 8),
child: LocaleKeys.enter_licence_detail.tr().toText(fontSize: 14, color: MyColors.lightTextColor),
),
TxtField(
hint: LocaleKeys.description.tr(),
maxLines: 3,
isBackgroundEnabled: true,
value: document.description != null ? document.description : "",
onChanged: (val) {
document.description = val;
},
),
],
10.height,
if (isNeedToShow(model: serviceVM, document: document)) ...[
PickedFilesContainer(
isReview: document.status == 4,
allowAdButton: false,
pickedFiles: isLocalOrNetworkFiles(model: serviceVM, document: document),
onCrossPressedPrimary: isNetworkImage(document: document)
? serviceVM.removeNetworkImage
: document.documentId == 1
? serviceVM.commerceRemove
: document.documentId == 2
? serviceVM.commercialRemove
: serviceVM.vatRemove,
isPdf: serviceVM.document!.data![index].fileExt == "pdf",
isFromNetwork: !(document.isLocalFile ?? false),
onAddFilePressed: () {
serviceVM.pickPdfReceiptFile(context, document.documentId!, index);
},
),
buildCommentContainer(document: document),
] else
...[
10.height,
DottedRectContainer(
onTap: () => serviceVM.pickPdfReceiptFile(context, document.documentId!, index) ?? "",
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
),
],
],
);
},
);
} }
List<ImageModel> isLocalOrNetworkFiles({required ServiceVM model, required DocumentData document}) { List<ImageModel> isLocalOrNetworkFiles({required ServiceVM model, required DocumentData document}) {

Loading…
Cancel
Save