From 5e1e0f162dd02a12a61ce632ef421de5ffd3ce28 Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:49:00 +0530 Subject: [PATCH] ios changes for force app update --- frontend/mgramseva/ios/Podfile.lock | 34 +++++---- .../ios/Runner.xcodeproj/project.pbxproj | 12 ++-- frontend/mgramseva/lib/main.dart | 2 +- .../lib/model/localization/language.dart | 13 +++- .../mgramseva/lib/utils/common_methods.dart | 71 +++++++++++-------- frontend/mgramseva/pubspec.lock | 20 +++--- 6 files changed, 90 insertions(+), 62 deletions(-) diff --git a/frontend/mgramseva/ios/Podfile.lock b/frontend/mgramseva/ios/Podfile.lock index 42efbb45a..fdae7fc54 100644 --- a/frontend/mgramseva/ios/Podfile.lock +++ b/frontend/mgramseva/ios/Podfile.lock @@ -1,6 +1,4 @@ PODS: - - bluetooth_thermal_printer (0.0.1): - - Flutter - charset_converter (0.0.1): - Flutter - DKImagePickerController/Core (4.3.4): @@ -95,7 +93,7 @@ PODS: - Flutter - flutter_keyboard_visibility (0.0.1): - Flutter - - flutter_secure_storage (3.3.1): + - flutter_secure_storage (6.0.0): - Flutter - flutter_share_me (0.0.1): - FBSDKCoreKit (~> 14.0.0) @@ -150,6 +148,8 @@ PODS: - nanopb/encode (= 2.30909.1) - nanopb/decode (2.30909.1) - nanopb/encode (2.30909.1) + - network_info_plus (0.0.1): + - Flutter - open_filex (0.0.2): - Flutter - package_info_plus (0.4.5): @@ -157,7 +157,7 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - "permission_handler (5.1.0+2)": + - permission_handler_apple (9.1.1): - Flutter - print_bluetooth_thermal (0.0.1): - Flutter @@ -168,11 +168,12 @@ PODS: - SDWebImage/Core (= 5.18.5) - SDWebImage/Core (5.18.5) - SwiftyGif (5.4.4) + - thermal_printer (1.0.0): + - Flutter - url_launcher_ios (0.0.1): - Flutter DEPENDENCIES: - - bluetooth_thermal_printer (from `.symlinks/plugins/bluetooth_thermal_printer/ios`) - charset_converter (from `.symlinks/plugins/charset_converter/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) @@ -184,12 +185,14 @@ DEPENDENCIES: - flutter_share_me (from `.symlinks/plugins/flutter_share_me/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) + - network_info_plus (from `.symlinks/plugins/network_info_plus/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 (from `.symlinks/plugins/permission_handler/ios`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - print_bluetooth_thermal (from `.symlinks/plugins/print_bluetooth_thermal/ios`) - printing (from `.symlinks/plugins/printing/ios`) + - thermal_printer (from `.symlinks/plugins/thermal_printer/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) SPEC REPOS: @@ -214,8 +217,6 @@ SPEC REPOS: - SwiftyGif EXTERNAL SOURCES: - bluetooth_thermal_printer: - :path: ".symlinks/plugins/bluetooth_thermal_printer/ios" charset_converter: :path: ".symlinks/plugins/charset_converter/ios" file_picker: @@ -238,23 +239,26 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/image_picker_ios/ios" integration_test: :path: ".symlinks/plugins/integration_test/ios" + network_info_plus: + :path: ".symlinks/plugins/network_info_plus/ios" open_filex: :path: ".symlinks/plugins/open_filex/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" print_bluetooth_thermal: :path: ".symlinks/plugins/print_bluetooth_thermal/ios" printing: :path: ".symlinks/plugins/printing/ios" + thermal_printer: + :path: ".symlinks/plugins/thermal_printer/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: - bluetooth_thermal_printer: 65b8304b3a1d8c67d466642a28cc2b4984409346 charset_converter: 215c7b04932ec2b9ba43be96a9bc34afed3e5322 DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 @@ -263,7 +267,7 @@ SPEC CHECKSUMS: FBSDKCoreKit_Basics: 1ff46a12e80f0b66e6c00e1ef32d6a5b5b9008a5 FBSDKLoginKit: dbe86ef42ab142f3bd0f1c904a21bb33f31c5569 FBSDKShareKit: 2f6a6a1445cc1b8ea0f733e60d02d2f7c4ebf8be - file_picker: ce3938a0df3cc1ef404671531facef740d03f920 + file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06 firebase_analytics: 3e5dba777bb51d1e0358b5a37adefa69746a94bd firebase_core: 29d66baf806970cda37c93621b27cd369b27db1b @@ -274,22 +278,24 @@ SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 - flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec + flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be flutter_share_me: 1fb559741e0dff56a9d2bdeaf4d966b0b47449ae GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 integration_test: 13825b8a9334a850581300559b8839134b124670 nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4 package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 + permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 print_bluetooth_thermal: 54a9ba9436479dd633d18f393669ee793ee498fa printing: 233e1b73bd1f4a05615548e9b5a324c98588640b PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 SDWebImage: 7ac2b7ddc5e8484c79aa90fc4e30b149d6a2c88f SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f + thermal_printer: 1885c43c3f17b912ca2c29e7f44822dddc2c24b9 url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 diff --git a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj index 399e9fb20..3ca8421fc 100644 --- a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj +++ b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 13; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -377,7 +377,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.16; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -504,7 +504,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 13; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -513,7 +513,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.16; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -532,7 +532,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 13; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -541,7 +541,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.16; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/frontend/mgramseva/lib/main.dart b/frontend/mgramseva/lib/main.dart index ef1617523..1221a7410 100644 --- a/frontend/mgramseva/lib/main.dart +++ b/frontend/mgramseva/lib/main.dart @@ -287,7 +287,7 @@ class _LandingPageState extends State { await commonProvider.getAppVersionDetails(); if (!kIsWeb) CommonMethods() - .checkVersion(context, commonProvider.appVersion!.latestAppVersion); + .checkVersion(context, commonProvider.appVersion!); } @override diff --git a/frontend/mgramseva/lib/model/localization/language.dart b/frontend/mgramseva/lib/model/localization/language.dart index 6884e5804..588dd9765 100644 --- a/frontend/mgramseva/lib/model/localization/language.dart +++ b/frontend/mgramseva/lib/model/localization/language.dart @@ -29,7 +29,8 @@ class LanguageList { return data; } } -class PSPCLIntegration{ + +class PSPCLIntegration { List? accountNumberGpMapping; PSPCLIntegration({this.accountNumberGpMapping}); @@ -52,6 +53,7 @@ class PSPCLIntegration{ return data; } } + class AccountNumberGpMapping { String? accountNumber; String? departmentEntityName; @@ -59,8 +61,8 @@ class AccountNumberGpMapping { AccountNumberGpMapping( {this.accountNumber, - this.departmentEntityName, - this.departmentEntityCode}); + this.departmentEntityName, + this.departmentEntityCode}); AccountNumberGpMapping.fromJson(Map json) { accountNumber = json['accountNumber']; @@ -76,6 +78,7 @@ class AccountNumberGpMapping { return data; } } + class MdmsRes { CommonMasters? commonMasters; BillingService? billingService; @@ -166,19 +169,23 @@ class CommonMasters { class AppVersion { String? latestAppVersion; + String? latestAppVersionIos; // List? localizationModules; AppVersion({ this.latestAppVersion, + this.latestAppVersionIos }); AppVersion.fromJson(Map json) { latestAppVersion = json['latestAppVersion']; + latestAppVersionIos = json['latestAppVersionIos']; } Map toJson() { final Map data = new Map(); data['latestAppVersion'] = this.latestAppVersion; + data['latestAppVersionIos'] = this.latestAppVersionIos; return data; } diff --git a/frontend/mgramseva/lib/utils/common_methods.dart b/frontend/mgramseva/lib/utils/common_methods.dart index 95c94184d..44aea98ff 100644 --- a/frontend/mgramseva/lib/utils/common_methods.dart +++ b/frontend/mgramseva/lib/utils/common_methods.dart @@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:http_parser/http_parser.dart'; +import 'package:mgramseva/model/localization/language.dart'; import 'package:mgramseva/model/mdms/tax_period.dart'; import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/utils/error_logging.dart'; @@ -57,56 +58,63 @@ class CommonMethods { * * */ - static List getPastMonthUntilFinancialYTD(DatePeriod ytd,{bool showCurrentMonth = false}) { + static List getPastMonthUntilFinancialYTD(DatePeriod ytd, + {bool showCurrentMonth = false}) { var monthList = []; final currentTime = DateTime.now(); - if(currentTime.year < ytd.startDate.year){ + if (currentTime.year < ytd.startDate.year) { return []; } if (currentTime.year == ytd.startDate.year) { //when current year is same as start year of financial year - for (int i = ytd.startDate.month; i <= (showCurrentMonth?currentTime.month:currentTime.month-1); i++) { + for (int i = ytd.startDate.month; + i <= (showCurrentMonth ? currentTime.month : currentTime.month - 1); + i++) { monthList.add(DateTime(currentTime.year, i)); } - } else if(currentTime.year == ytd.endDate.year){ + } else if (currentTime.year == ytd.endDate.year) { //when current year is same as end year of financial year for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } for (int i = 1; - i <= (currentTime.month <= ytd.endDate.month ? showCurrentMonth?currentTime.month:currentTime.month-1: ytd.endDate.month); - /* + i <= + (currentTime.month <= ytd.endDate.month + ? showCurrentMonth + ? currentTime.month + : currentTime.month - 1 + : ytd.endDate.month); + /* * if current month is less than or equal to end month of financial year * we are using months less than current month and if it is more than * end month of financial year we are using till end month of financial * year */ - i++) { + i++) { monthList.add(DateTime(ytd.endDate.year, i)); } - }else{ + } else { for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } - for (int i = 1; - i <= ytd.endDate.month; - i++) { - monthList.add(DateTime(ytd.endDate.year , i)); + for (int i = 1; i <= ytd.endDate.month; i++) { + monthList.add(DateTime(ytd.endDate.year, i)); } } var list = monthList .map((e) => DatePeriod(DateTime(e.year, e.month, 1), - DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) + DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) .toList() .reversed .toList(); return list; } - static List getPastMonthIncludingCurrentMonthUntilFinancialYTD(DatePeriod ytd) { + static List getPastMonthIncludingCurrentMonthUntilFinancialYTD( + DatePeriod ytd) { var monthList = []; final currentTime = DateTime.now(); - if(currentTime.year < ytd.startDate.year){ + if (currentTime.year < ytd.startDate.year) { return []; } if (currentTime.year == ytd.startDate.year) { @@ -114,35 +122,36 @@ class CommonMethods { for (int i = ytd.startDate.month; i <= currentTime.month; i++) { monthList.add(DateTime(currentTime.year, i)); } - } else if(currentTime.year == ytd.endDate.year){ + } else if (currentTime.year == ytd.endDate.year) { //when current year is same as end year of financial year for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } for (int i = 1; - i <= (currentTime.month <= ytd.endDate.month ? currentTime.month: ytd.endDate.month); - /* + i <= + (currentTime.month <= ytd.endDate.month + ? currentTime.month + : ytd.endDate.month); + /* * if current month is less than or equal to end month of financial year * we are using months less than current month and if it is more than * end month of financial year we are using till end month of financial * year */ - i++) { + i++) { monthList.add(DateTime(ytd.endDate.year, i)); } - }else{ + } else { for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } - for (int i = 1; - i <= ytd.endDate.month; - i++) { - monthList.add(DateTime(ytd.endDate.year , i)); + for (int i = 1; i <= ytd.endDate.month; i++) { + monthList.add(DateTime(ytd.endDate.year, i)); } } var list = monthList .map((e) => DatePeriod(DateTime(e.year, e.month, 1), - DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) + DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) .toList() .reversed .toList(); @@ -178,7 +187,9 @@ class CommonMethods { } return yearWithMonths; } - static List getFinancialYearListWithCurrentMonthForCurrentYear([int count = 5]) { + + static List + getFinancialYearListWithCurrentMonthForCurrentYear([int count = 5]) { var yearWithMonths = []; if (DateTime.now().month >= 4) { @@ -283,10 +294,14 @@ class CommonMethods { } } - void checkVersion(BuildContext context, String? latestAppVersion) async { + void checkVersion(BuildContext context, AppVersion appVersion) async { try { + String? latestAppVersion = Platform.isIOS + ? appVersion.latestAppVersionIos + : appVersion.latestAppVersion; + print("app" + latestAppVersion!); if (latestAppVersion != null && !kIsWeb) { - if (int.parse(packageInfo!.version.split('.').join("").toString()) < + if (int.parse(packageInfo!.version.split('.').join("").toString()) > int.parse(latestAppVersion.split('.').join("").toString())) { late Uri uri; diff --git a/frontend/mgramseva/pubspec.lock b/frontend/mgramseva/pubspec.lock index a72f461ba..e744e5644 100644 --- a/frontend/mgramseva/pubspec.lock +++ b/frontend/mgramseva/pubspec.lock @@ -313,14 +313,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" - esc_pos_utils_plus: - dependency: "direct main" - description: - name: esc_pos_utils_plus - sha256: dca660e2bf5622c3b9bc54ce098128606a8942ff07f1e2d2f4c88e483df3fe74 - url: "https://pub.dev" - source: hosted - version: "2.0.2" fake_async: dependency: transitive description: @@ -454,6 +446,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.0" + flutter_dotenv: + dependency: "direct main" + description: + name: flutter_dotenv + sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + url: "https://pub.dev" + source: hosted + version: "5.1.0" flutter_downloader: dependency: "direct main" description: @@ -1373,10 +1373,10 @@ packages: dependency: "direct main" description: name: thermal_printer - sha256: "887ad5be1d3db42a2259fd0ad636fa6f873db30669fa7eaebcb57c446ff09344" + sha256: d04fd0ade194df0143bcef57af18cad59fa053be6e7102c5d341f378325c7508 url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.0.4" timing: dependency: transitive description: