Commit 45eb1b57 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios changes from Mac

parent 33d1b84a
......@@ -78,6 +78,8 @@ PODS:
- Flutter
- flutter_downloader (0.0.1):
- Flutter
- flutter_foreground_task (0.0.1):
- Flutter
- flutter_image_compress_common (1.0.0):
- Flutter
- Mantle
......@@ -168,6 +170,8 @@ PODS:
- nanopb/encode (= 3.30910.0)
- nanopb/decode (3.30910.0)
- nanopb/encode (3.30910.0)
- open_filex (0.0.2):
- Flutter
- OrderedSet (5.0.0)
- package_info_plus (0.4.5):
- Flutter
......@@ -216,6 +220,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`)
- flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
- flutter_foreground_task (from `.symlinks/plugins/flutter_foreground_task/ios`)
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
......@@ -228,6 +233,7 @@ DEPENDENCIES:
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- location (from `.symlinks/plugins/location/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
......@@ -284,6 +290,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_contacts/ios"
flutter_downloader:
:path: ".symlinks/plugins/flutter_downloader/ios"
flutter_foreground_task:
:path: ".symlinks/plugins/flutter_foreground_task/ios"
flutter_image_compress_common:
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
flutter_inappwebview_ios:
......@@ -308,6 +316,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios"
location:
:path: ".symlinks/plugins/location/ios"
open_filex:
:path: ".symlinks/plugins/open_filex/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
......@@ -349,6 +359,7 @@ SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983
flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39
flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_inappwebview_ios: 8d8d2c6290a3c4787cad303603662fac9a788f75
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
......@@ -369,6 +380,7 @@ SPEC CHECKSUMS:
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
......
......@@ -25,6 +25,7 @@ class _ContactListScreenState extends State<ContactListScreen> {
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_requestContactsPermission();
final homeProv = Provider.of<HomescreenNotifier>(context, listen: false);
Future.microtask(() {
final provider = Provider.of<ContactProvider>(context, listen: false);
......@@ -33,6 +34,20 @@ class _ContactListScreenState extends State<ContactListScreen> {
});
}
Future<void> _requestContactsPermission() async {
final status = await Permission.contacts.status;
if (status.isPermanentlyDenied) {
// Show dialog and send user to settings
await openAppSettings();
return;
}
if (!status.isGranted) {
await Permission.contacts.request();
}
}
void _addToContact(String name, String phoneNumber) async {
if (phoneNumber.isEmpty) {
CustomSnackBar.showError(
......
......@@ -946,7 +946,8 @@ class _VisitdetailsState extends State<Visitdetails> {
.fsrExt!,
fileUrl:
"https://erp.gengroup.in/files_genservices/tech_fsr_report/${followups[lp].fsrExt!}",
downloadEnable: false,
downloadEnable:
false,
),
),
);
......@@ -999,7 +1000,6 @@ class _VisitdetailsState extends State<Visitdetails> {
),
],
if (complaintBillList.isNotEmpty) ...[
Container(
padding: EdgeInsets.symmetric(
......@@ -1028,10 +1028,14 @@ class _VisitdetailsState extends State<Visitdetails> {
return Card(
margin: EdgeInsets.only(bottom: 12),
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(padding: const EdgeInsets.all(14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
child: Padding(
padding: const EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// _detailRow("Bill ID", item.billId),
// _detailRow("Total Amount", item.totalAmount),
......@@ -1040,7 +1044,6 @@ class _VisitdetailsState extends State<Visitdetails> {
// _detailRow("Bill Date", item.billDate),
// _detailRow("Due Date", item.dueDate),
// _detailRow("Bill Paid", item.billPaid == "1" ? "Yes" : "No"),
Row(
children: [
// 👤 Avatar
......@@ -1062,74 +1065,96 @@ class _VisitdetailsState extends State<Visitdetails> {
// 📝 Info
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
item.narration ?? "-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontFamily: "JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
color: AppColors.semi_black,
),
),
const SizedBox(height: 3),
if (item.billPaid != "0")
Text(item.totalAmount ?? "",
Text(
item.totalAmount ?? "",
style: TextStyle(
fontSize: 14,
color: AppColors.app_blue,
),),
),
),
],
),
),
if (item.billPaid != "1")
Text(item.totalAmount ?? "",
Text(
item.totalAmount ?? "",
style: TextStyle(
fontSize: 14,
color: AppColors.app_blue,
),),
),
),
// Call
if (item.billPaid != "0")
InkResponse(
onTap: (){
var homeProvider = Provider.of<HomescreenNotifier>(
context,
listen: false,
);
onTap: () {
var homeProvider = Provider.of<
HomescreenNotifier
>(context, listen: false);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => RazorpayQrScreen(
sessionId: homeProvider.session,
empId: homeProvider.empId,
amount: item.rawAmount.toString(),
MaterialPageRoute(
builder:
(
context,
) => RazorpayQrScreen(
sessionId:
homeProvider
.session,
empId:
homeProvider
.empId,
amount:
item.rawAmount
.toString(),
refType: "Bill",
refId: item.billId.toString()
))
refId:
item.billId
.toString(),
),
),
);
},
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
padding:
const EdgeInsets.symmetric(
horizontal: 12,
vertical: 6,
),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: AppColors.app_blue,
width: 1,
),
borderRadius: BorderRadius.circular(8),
borderRadius:
BorderRadius.circular(8),
),
child: Text("Pay Now", style: TextStyle(
child: Text(
"Pay Now",
style: TextStyle(
fontSize: 14,
color: Colors.black87,
),),
),
)
),
),
),
],
),
SizedBox(height: 10,),
SizedBox(height: 10),
Row(
children: [
Expanded(
......@@ -1154,7 +1179,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
],
),
SizedBox(height: 4,),
SizedBox(height: 4),
_detailRow("Bill Date", item.billDate),
_detailRow("Due Date", item.dueDate),
],
......@@ -1162,7 +1187,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
);
},
)
),
),
],
SizedBox(height: 75),
......@@ -1194,7 +1219,10 @@ class _VisitdetailsState extends State<Visitdetails> {
provider
.complaintDetailsNew
.complaintId,
complaintType: provider.complaintDetailsNew.complaintType,
complaintType:
provider
.complaintDetailsNew
.complaintType,
),
),
);
......@@ -1386,12 +1414,9 @@ class _VisitdetailsState extends State<Visitdetails> {
);
}
Widget _detailRow(String title, String? value) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 3,
),
padding: EdgeInsets.symmetric(vertical: 3),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -1408,10 +1433,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
Text(
value ?? "--",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
),
style: TextStyle(fontSize: 14, color: AppColors.grey_semi),
),
],
),
......
......@@ -217,6 +217,7 @@ class _SplashState extends State<Splash> {
splashImage = Image.asset("assets/images/ic_splash.jpg");
WidgetsBinding.instance.addPostFrameCallback((_) {
requestPermissions();
_requestContactsPermission();
final spalshProvider = Provider.of<SplashVersionNotifier>(
context,
listen: false,
......@@ -245,6 +246,20 @@ class _SplashState extends State<Splash> {
await getLocationPermissions();
}
Future<void> _requestContactsPermission() async {
final status = await Permission.contacts.status;
if (status.isPermanentlyDenied) {
// Show dialog and send user to settings
await openAppSettings();
return;
}
if (!status.isGranted) {
await Permission.contacts.request();
}
}
Future<void> getStoragePermission() async {
if (await Permission.manageExternalStorage.request().isGranted) {
print("Storage");
......
......@@ -232,7 +232,10 @@ class ApiCalling {
}
}
static Future<MissedCheckoutStripResponse?> missedCheckoutStripApi(empId, session) async {
static Future<MissedCheckoutStripResponse?> missedCheckoutStripApi(
empId,
session,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -956,7 +959,6 @@ class ApiCalling {
'session_id': (session).toString(),
'emp_loc': (techLoc).toString(),
'radius': (radius).toString(),
};
final res = await post(data, crmNearbyGeneratorsUrl, {});
if (res != null) {
......@@ -997,13 +999,13 @@ class ApiCalling {
return null;
}
}
/// service Complaint Bill List Api
static Future<ServiceComplaintBillListResponse?> serviceComplaintBillListAPI(
empId,
session,
complaintId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -1025,7 +1027,6 @@ class ApiCalling {
}
}
static Future<TechnicianPendingComplaintsResponse?>
LoadTechnicianComplaintsAPI(empId, session) async {
try {
......@@ -1278,7 +1279,6 @@ class ApiCalling {
session,
compId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -1785,12 +1785,8 @@ class ApiCalling {
}
/// validate bank account details api
static Future<ValidateBankAccountDetailsResponse?> validateBankAccountDetailsApi(
empId,
session,
accountNum,
ifscCode
) async {
static Future<ValidateBankAccountDetailsResponse?>
validateBankAccountDetailsApi(empId, session, accountNum, ifscCode) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -1801,7 +1797,9 @@ class ApiCalling {
final res = await post(data, validateBankAccountDetailsUrl, {});
if (res != null) {
debugPrint(res.body);
return ValidateBankAccountDetailsResponse.fromJson(jsonDecode(res.body));
return ValidateBankAccountDetailsResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
......@@ -1861,13 +1859,11 @@ class ApiCalling {
if (res != null) {
print("Input Date: $data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body),
);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
......@@ -2605,8 +2601,7 @@ class ApiCalling {
feedback,
followupType,
inTime,
loc
loc,
) async {
try {
Map<String, String> data = {
......@@ -2629,7 +2624,6 @@ class ApiCalling {
debugPrint("=================End of INput=================");
final res = await post(data, ordersAddOrderViewUrl, {});
if (res != null) {
// debugPrint("Response start ================== ${AddOrderViewResponse.fromJson(jsonDecode(res.body)).accountDetails?.name}");
......@@ -4876,7 +4870,7 @@ class ApiCalling {
'quantity': quantity.toString(),
'amount': amount.toString(),
'lead_status': leadStatus.toString(),
'remarks' : remarks.toString(),
'remarks': remarks.toString(),
};
final res = await post(data, crmProspectDetailsAddLeadUrl, {});
if (res != null) {
......@@ -5721,7 +5715,8 @@ class ApiCalling {
return null;
}
}
/// CasualLeaveHistory api
/// CasualLeaveHistory api
static Future<CasualLeaveHistoryResponse?> casualLeaveHistoryAPI(
session,
empId,
......@@ -5820,14 +5815,15 @@ class ApiCalling {
static Future<AdvanceListResponse?> advanceListAPI(
session,
empId,
pageNumber
pageNumber,
) async {
debugPrint("🔥🔥🔥🔥🔥🔥🔥Response");
try {
Map<String, String> data = {
'session_id': (session).toString(),
'emp_id': (empId).toString(),
'page_number': (pageNumber).toString(), // FIX: Use pageNumber parameter, not empId
'page_number':
(pageNumber).toString(), // FIX: Use pageNumber parameter, not empId
};
final res = await post(data, AdvanceListUrl, {});
if (res != null) {
......@@ -5848,7 +5844,7 @@ class ApiCalling {
static Future<ContactListResponse?> contactListAPI(
session,
empId,
pageNumber
pageNumber,
) async {
debugPrint("Response");
try {
......@@ -5871,13 +5867,12 @@ class ApiCalling {
}
}
static Future<CommonResponse?> fetchRazorpayUpiQrApi(
session,
empId,
amount,
refType,
refId
refId,
) async {
try {
Map<String, String> data = {
......@@ -5886,7 +5881,6 @@ class ApiCalling {
'amount': (amount),
'ref_type': (refType).toString(),
'ref_id': (refId),
};
debugPrint("Input to QR : $data");
final res = await post(data, createRazorpayUpiQrUrl, {});
......@@ -5908,15 +5902,12 @@ class ApiCalling {
session,
empId,
razorpayOrderId,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
'emp_id': (empId).toString(),
'razorpay_order_id': (razorpayOrderId),
};
final res = await post(data, fetchRazorpayUpiQrStatusUrl, {});
if (res != null) {
......@@ -5972,7 +5963,11 @@ class ApiCalling {
// }
// }
static Future<CommonResponse?> trackLiveLocationEmpolyeeAPI(empId, session,location) async {
static Future<CommonResponse?> trackLiveLocationEmpolyeeAPI(
empId,
session,
location,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -5995,5 +5990,4 @@ class ApiCalling {
return null;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment