From 47cdf7196810e82b55c9bf1919a7590a40a99f7d Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Tue, 11 Nov 2025 10:48:18 +0700 Subject: [PATCH] change package --- android/app/build.gradle.kts | 4 +- .../worker => dbiz/partner}/MainActivity.kt | 2 +- ios/Runner.xcodeproj/project.pbxproj | 19 ++-- lib/app.dart | 2 +- .../presentation/pages/products_page.dart | 100 +++++------------- .../presentation/widgets/product_card.dart | 1 + pubspec.lock | 8 ++ pubspec.yaml | 2 + 8 files changed, 48 insertions(+), 90 deletions(-) rename android/app/src/main/kotlin/com/{example/worker => dbiz/partner}/MainActivity.kt (77%) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 3d0d405..895c4a1 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.worker" + namespace = "com.dbiz.partner" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -21,7 +21,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.worker" + applicationId = "com.dbiz.partner" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion diff --git a/android/app/src/main/kotlin/com/example/worker/MainActivity.kt b/android/app/src/main/kotlin/com/dbiz/partner/MainActivity.kt similarity index 77% rename from android/app/src/main/kotlin/com/example/worker/MainActivity.kt rename to android/app/src/main/kotlin/com/dbiz/partner/MainActivity.kt index 1ce9c7f..31ba8c5 100644 --- a/android/app/src/main/kotlin/com/example/worker/MainActivity.kt +++ b/android/app/src/main/kotlin/com/dbiz/partner/MainActivity.kt @@ -1,4 +1,4 @@ -package com.example.worker +package com.dbiz.partner import io.flutter.embedding.android.FlutterActivity diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 19c6a87..4c1fe32 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -152,7 +152,6 @@ 01651DC8E3A322D39483596C /* Pods-RunnerTests.release.xcconfig */, 18121E1016DEC4038E74F1F0 /* Pods-RunnerTests.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -489,14 +488,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = W759YCT9DM; + DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -513,7 +512,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -531,7 +530,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -547,7 +546,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -672,14 +671,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = W759YCT9DM; + DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -695,14 +694,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = W759YCT9DM; + DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; + PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/lib/app.dart b/lib/app.dart index be2a199..3798041 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -25,7 +25,7 @@ class WorkerApp extends ConsumerWidget { return MaterialApp.router( // ==================== App Configuration ==================== debugShowCheckedModeBanner: false, - title: 'Worker App', + title: 'DBIZ Partner', // ==================== Router Configuration ==================== // Using go_router for declarative routing with deep linking support diff --git a/lib/features/products/presentation/pages/products_page.dart b/lib/features/products/presentation/pages/products_page.dart index a16210d..b1d3f76 100644 --- a/lib/features/products/presentation/pages/products_page.dart +++ b/lib/features/products/presentation/pages/products_page.dart @@ -57,10 +57,7 @@ class ProductsPage extends ConsumerWidget { backgroundColor: AppColors.danger, textColor: AppColors.white, isLabelVisible: cartItemCount > 0, - child: const Icon( - Icons.shopping_cart_outlined, - color: Colors.black, - ), + child: const Icon(Icons.shopping_cart_outlined, color: Colors.black), ), onPressed: () => context.push(RouteNames.cart), ), @@ -77,9 +74,7 @@ class ProductsPage extends ConsumerWidget { child: Row( children: [ // Search Bar (Expanded) - const Expanded( - child: ProductSearchBar(), - ), + const Expanded(child: ProductSearchBar()), const SizedBox(width: 8), // Filter Button SizedBox( @@ -90,25 +85,14 @@ class ProductsPage extends ConsumerWidget { Scaffold.of(scaffoldContext).openEndDrawer(); }, icon: const Icon(Icons.filter_list, size: 20), - label: const Text( - 'Lọc', - style: TextStyle(fontSize: 12), - ), + label: const Text('Lọc', style: TextStyle(fontSize: 12)), style: OutlinedButton.styleFrom( foregroundColor: AppColors.grey900, - side: const BorderSide( - color: AppColors.white, - width: 0, - ), + side: const BorderSide(color: AppColors.white, width: 0), backgroundColor: AppColors.white, - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, - ), + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - InputFieldSpecs.borderRadius, - ), + borderRadius: BorderRadius.circular(InputFieldSpecs.borderRadius), ), ), ), @@ -117,15 +101,13 @@ class ProductsPage extends ConsumerWidget { ), ), - // Category Filter Chips - categoriesAsync.when( - data: (categories) => CategoryFilterChips(categories: categories), - loading: () => const SizedBox( - height: 48.0, - child: Center(child: CircularProgressIndicator(strokeWidth: 2.0)), - ), - error: (error, stack) => const SizedBox.shrink(), - ), + // Category Filter Chips + categoriesAsync.when( + data: (categories) => CategoryFilterChips(categories: categories), + loading: () => + const SizedBox(height: 48.0, child: Center(child: CircularProgressIndicator(strokeWidth: 2.0))), + error: (error, stack) => const SizedBox.shrink(), + ), const SizedBox(height: AppSpacing.sm), @@ -149,21 +131,16 @@ class ProductsPage extends ConsumerWidget { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: - Text('${product.name} đã thêm vào giỏ hàng'), + content: Text('${product.name} đã thêm vào giỏ hàng'), duration: const Duration(seconds: 2), - action: SnackBarAction( - label: 'Xem', - onPressed: () => context.go(RouteNames.cart), - ), + action: SnackBarAction(label: 'Xem', onPressed: () => context.go(RouteNames.cart)), ), ); }, ); }, loading: () => _buildLoadingState(), - error: (error, stack) => - _buildErrorState(context, l10n, error, ref), + error: (error, stack) => _buildErrorState(context, l10n, error, ref), ), ), ], @@ -179,25 +156,14 @@ class ProductsPage extends ConsumerWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( - Icons.inventory_2_outlined, - size: 80.0, - color: AppColors.grey500.withAlpha(128), - ), + Icon(Icons.inventory_2_outlined, size: 80.0, color: AppColors.grey500.withAlpha(128)), const SizedBox(height: AppSpacing.lg), Text( l10n.noProductsFound, - style: const TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w500, - color: AppColors.grey900, - ), + style: const TextStyle(fontSize: 18.0, fontWeight: FontWeight.w500, color: AppColors.grey900), ), const SizedBox(height: AppSpacing.sm), - Text( - l10n.noResults, - style: const TextStyle(fontSize: 14.0, color: AppColors.grey500), - ), + Text(l10n.noResults, style: const TextStyle(fontSize: 14.0, color: AppColors.grey500)), ], ), ); @@ -205,37 +171,22 @@ class ProductsPage extends ConsumerWidget { /// Build loading state Widget _buildLoadingState() { - return const Center( - child: CircularProgressIndicator(color: AppColors.primaryBlue), - ); + return const Center(child: CircularProgressIndicator(color: AppColors.primaryBlue)); } /// Build error state - Widget _buildErrorState( - BuildContext context, - AppLocalizations l10n, - Object error, - WidgetRef ref, - ) { + Widget _buildErrorState(BuildContext context, AppLocalizations l10n, Object error, WidgetRef ref) { return Center( child: Padding( padding: const EdgeInsets.all(AppSpacing.xl), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( - Icons.error_outline, - size: 80.0, - color: AppColors.danger.withAlpha(128), - ), + Icon(Icons.error_outline, size: 80.0, color: AppColors.danger.withAlpha(128)), const SizedBox(height: AppSpacing.lg), Text( l10n.error, - style: const TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w600, - color: AppColors.grey900, - ), + style: const TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600, color: AppColors.grey900), ), const SizedBox(height: AppSpacing.sm), Text( @@ -253,10 +204,7 @@ class ProductsPage extends ConsumerWidget { style: ElevatedButton.styleFrom( backgroundColor: AppColors.primaryBlue, foregroundColor: AppColors.white, - padding: const EdgeInsets.symmetric( - horizontal: AppSpacing.lg, - vertical: AppSpacing.md, - ), + padding: const EdgeInsets.symmetric(horizontal: AppSpacing.lg, vertical: AppSpacing.md), ), ), ], diff --git a/lib/features/products/presentation/widgets/product_card.dart b/lib/features/products/presentation/widgets/product_card.dart index 619fc1f..6917d08 100644 --- a/lib/features/products/presentation/widgets/product_card.dart +++ b/lib/features/products/presentation/widgets/product_card.dart @@ -42,6 +42,7 @@ class ProductCard extends ConsumerWidget { return Card( elevation: ProductCardSpecs.elevation, + margin: const EdgeInsets.all(8), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(ProductCardSpecs.borderRadius), ), diff --git a/pubspec.lock b/pubspec.lock index a1f62a4..f527c16 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -153,6 +153,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + change_app_package_name: + dependency: "direct dev" + description: + name: change_app_package_name + sha256: "8e43b754fe960426904d77ed4c62fa8c9834deaf6e293ae40963fa447482c4c5" + url: "https://pub.dev" + source: hosted + version: "1.5.0" characters: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2aa004d..a0471c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -73,6 +73,7 @@ dependencies: shared_preferences: ^2.2.3 flutter_secure_storage: ^9.2.4 + # Navigation go_router: ^14.6.2 @@ -94,6 +95,7 @@ dev_dependencies: # Linting flutter_lints: ^5.0.0 + change_app_package_name: ^1.5.0 # Testing mockito: ^5.4.4