Merge branch 'master_mohemm_flutter' into development_haroon

merge-requests/3/head
haroon amjad 3 years ago
commit 5eb82d04ae

@ -21,7 +21,6 @@ import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:nfc_manager/nfc_manager.dart'; import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart'; import 'package:nfc_manager/platform_tags.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:store_checker/store_checker.dart';
// ignore_for_file: avoid_annotating_with_dynamic // ignore_for_file: avoid_annotating_with_dynamic

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
@ -71,27 +72,31 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
} }
} }
void submitRequest() async { Future<List<Map<String, dynamic>>> addAttachments() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> list = []; List<Map<String, dynamic>> list = [];
if (attachmentFiles.isNotEmpty) { if (attachmentFiles.isNotEmpty) {
attachments.asMap().forEach((index, value) async { attachmentFiles.asMap().forEach((index, value) {
String type = attachmentFiles[index].path.split('.').last; String type = attachmentFiles[index].path.split('.').last;
String name = attachmentFiles[index].path.split('/').last; String name = attachmentFiles[index].path.split('/').last;
// List<int> fileContent = await value.readAsBytes(); List<int> fileContent = value.readAsBytesSync();
// String encodedFile = base64Encode(fileContent); String encodedFile = base64Encode(fileContent);
list.add(AttachmentModel( list.add(AttachmentModel(
attachmentID: index, attachmentID: index,
pFILECONTENTTYPE: type, pFILECONTENTTYPE: type,
pFILENAME: name, pFILENAME: name,
pFILEDATA: value, pFILEDATA: encodedFile,
pTRANSACTIONID: params!.transactionId, pTRANSACTIONID: params!.transactionId,
).toJson()); ).toJson());
}); });
} }
await MyAttendanceApiClient().addAttachment(list); return list;
}
void submitRequest() async {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> list = await addAttachments();
await MyAttendanceApiClient().addAttachment(list);
if (params!.approvalFlag == 'phone_numbers') { if (params!.approvalFlag == 'phone_numbers') {
await ProfileApiClient().startPhoneApprovalProcess( await ProfileApiClient().startPhoneApprovalProcess(
"SUBMIT", "SUBMIT",

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -107,22 +105,34 @@ class _ItemForSaleDetailPageState extends State<ItemForSaleDetailPage> {
).expanded, ).expanded,
Row( Row(
children: [ children: [
DefaultButton("Email", () async { DefaultButton(
"Email",
getItemsForSaleList.status == 'Approved'
? () async {
Uri emailLaunchUri = Uri( Uri emailLaunchUri = Uri(
scheme: 'mailto', scheme: 'mailto',
path: getItemsForSaleList.emailAddress, path: getItemsForSaleList.emailAddress,
); );
launchUrl(emailLaunchUri); launchUrl(emailLaunchUri);
}, iconData: Icons.email_sharp, isTextExpanded: false) }
: null,
iconData: Icons.email_sharp,
isTextExpanded: false)
.expanded, .expanded,
8.width, 8.width,
DefaultButton("Call", () async { DefaultButton(
"Call",
getItemsForSaleList.status == 'Approved'
? () async {
Uri callLaunchUri = Uri( Uri callLaunchUri = Uri(
scheme: 'tel', scheme: 'tel',
path: getItemsForSaleList.mobileNumber, path: getItemsForSaleList.mobileNumber,
); );
launchUrl(callLaunchUri); launchUrl(callLaunchUri);
}, iconData: Icons.call_sharp, isTextExpanded: false) }
: null,
iconData: Icons.call_sharp,
isTextExpanded: false)
.expanded, .expanded,
], ],
).insideContainer, ).insideContainer,

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.2.91+300030 version: 3.2.93+300032
environment: environment:
sdk: ">=2.16.0 <3.0.0" sdk: ">=2.16.0 <3.0.0"
@ -114,7 +114,7 @@ dependencies:
carousel_slider: ^4.2.1 carousel_slider: ^4.2.1
#Huawei Specified #Huawei Specified
store_checker: ^1.1.0 # store_checker: ^1.1.0
google_api_availability: ^3.0.1 google_api_availability: ^3.0.1

Loading…
Cancel
Save