From d26e7e37747f683888b9555d024bb851c15c0cff Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Fri, 24 Oct 2025 15:24:14 +0530 Subject: [PATCH] refactor: update package and bundle identifiers to com.onfieldwork.marcoaiot --- android/app/build.gradle | 2 +- .../com/example/maxdash/MainActivity.kt | 2 +- ios/Runner.xcodeproj/project.pbxproj | 12 +++++------ .../expense/reimbursement_bottom_sheet.dart | 21 ++++++++++++------- lib/view/expense/expense_detail_screen.dart | 5 +++-- linux/CMakeLists.txt | 2 +- macos/Runner.xcodeproj/project.pbxproj | 6 +++--- macos/Runner/Configs/AppInfo.xcconfig | 2 +- 8 files changed, 30 insertions(+), 22 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 689033a..7cb551f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -15,7 +15,7 @@ if (keystorePropertiesFile.exists()) { android { // Define the namespace for your Android application - namespace = "com.marco.aiot" + namespace = "com.onfieldwork.marcoaiot" // Set the compile SDK version based on Flutter's configuration compileSdk = flutter.compileSdkVersion // Set the NDK version based on Flutter's configuration diff --git a/android/app/src/main/kotlin/com/example/maxdash/MainActivity.kt b/android/app/src/main/kotlin/com/example/maxdash/MainActivity.kt index 629b9af..fcacfad 100644 --- a/android/app/src/main/kotlin/com/example/maxdash/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/maxdash/MainActivity.kt @@ -1,4 +1,4 @@ -package com.marco.aiot +package com.onfieldwork.marcoaiot import io.flutter.embedding.android.FlutterActivity diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 438e434..065543e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +384,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +401,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +416,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -547,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -569,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/lib/model/expense/reimbursement_bottom_sheet.dart b/lib/model/expense/reimbursement_bottom_sheet.dart index 6d4c183..d48518d 100644 --- a/lib/model/expense/reimbursement_bottom_sheet.dart +++ b/lib/model/expense/reimbursement_bottom_sheet.dart @@ -162,17 +162,24 @@ class _ReimbursementBottomSheetState extends State { MySpacing.height(8), GestureDetector( onTap: () async { + // Parse transaction date from controller + final transactionDate = DateTime.tryParse( + controller.expense.value?.transactionDate ?? ''); + final today = DateTime.now(); + + // Fallback if transactionDate is null + final firstDate = transactionDate ?? DateTime(2020); + final lastDate = today; + final picked = await showDatePicker( context: context, - initialDate: dateStr.value.isEmpty - ? DateTime.now() - : DateFormat('dd MMM yyyy').parse(dateStr.value), - firstDate: DateTime(2020), - lastDate: DateTime(2100), + initialDate: today.isBefore(firstDate) ? firstDate : today, + firstDate: firstDate, + lastDate: lastDate, ); + if (picked != null) { - dateStr.value = - DateFormat('dd MMM yyyy').format(picked); + dateStr.value = DateFormat('dd MMM yyyy').format(picked); } }, child: AbsorbPointer( diff --git a/lib/view/expense/expense_detail_screen.dart b/lib/view/expense/expense_detail_screen.dart index ecb5b6e..04911fd 100644 --- a/lib/view/expense/expense_detail_screen.dart +++ b/lib/view/expense/expense_detail_screen.dart @@ -21,6 +21,7 @@ import 'package:marco/helpers/widgets/my_text.dart'; import 'package:marco/helpers/services/storage/local_storage.dart'; import 'package:marco/model/employees/employee_info.dart'; import 'package:timeline_tile/timeline_tile.dart'; +import 'package:marco/helpers/utils/mixins/ui_mixin.dart'; class ExpenseDetailScreen extends StatefulWidget { final String expenseId; @@ -30,7 +31,7 @@ class ExpenseDetailScreen extends StatefulWidget { State createState() => _ExpenseDetailScreenState(); } -class _ExpenseDetailScreenState extends State { +class _ExpenseDetailScreenState extends State with UIMixin { final controller = Get.put(ExpenseDetailController()); final projectController = Get.find(); final permissionController = Get.find(); @@ -195,7 +196,7 @@ class _ExpenseDetailScreenState extends State { await showAddExpenseBottomSheet(isEdit: true); await controller.fetchExpenseDetails(); }, - backgroundColor: Colors.red, + backgroundColor: contentTheme.primary, icon: const Icon(Icons.edit), label: MyText.bodyMedium( "Edit Expense", fontWeight: 600, color: Colors.white), diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index b0b5577..cb7c5a2 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "marco") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.marco.aiot") +set(APPLICATION_ID "com.onfieldwork.marcoaiot") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index cc7ae89..cbcf812 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -385,7 +385,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/marco.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/marco"; @@ -399,7 +399,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/marco.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/marco"; @@ -413,7 +413,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/marco.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/marco"; diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 39359c4..e5e5002 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -8,7 +8,7 @@ PRODUCT_NAME = marco // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.marco.aiot +PRODUCT_BUNDLE_IDENTIFIER = com.onfieldwork.marcoaiot // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.