change package

This commit is contained in:
Phuoc Nguyen
2025-11-11 10:48:18 +07:00
parent 4e40a52b84
commit 47cdf71968
8 changed files with 48 additions and 90 deletions

View File

@@ -6,7 +6,7 @@ plugins {
} }
android { android {
namespace = "com.example.worker" namespace = "com.dbiz.partner"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion ndkVersion = flutter.ndkVersion
@@ -21,7 +21,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // 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. // You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion minSdk = flutter.minSdkVersion

View File

@@ -1,4 +1,4 @@
package com.example.worker package com.dbiz.partner
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity

View File

@@ -152,7 +152,6 @@
01651DC8E3A322D39483596C /* Pods-RunnerTests.release.xcconfig */, 01651DC8E3A322D39483596C /* Pods-RunnerTests.release.xcconfig */,
18121E1016DEC4038E74F1F0 /* Pods-RunnerTests.profile.xcconfig */, 18121E1016DEC4038E74F1F0 /* Pods-RunnerTests.profile.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@@ -489,14 +488,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W759YCT9DM; DEVELOPMENT_TEAM = 9R5X2DM2C8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -513,7 +512,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -531,7 +530,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -547,7 +546,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -672,14 +671,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W759YCT9DM; DEVELOPMENT_TEAM = 9R5X2DM2C8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -695,14 +694,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W759YCT9DM; DEVELOPMENT_TEAM = 9R5X2DM2C8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.worker; PRODUCT_BUNDLE_IDENTIFIER = com.dbiz.partner;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;

View File

@@ -25,7 +25,7 @@ class WorkerApp extends ConsumerWidget {
return MaterialApp.router( return MaterialApp.router(
// ==================== App Configuration ==================== // ==================== App Configuration ====================
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Worker App', title: 'DBIZ Partner',
// ==================== Router Configuration ==================== // ==================== Router Configuration ====================
// Using go_router for declarative routing with deep linking support // Using go_router for declarative routing with deep linking support

View File

@@ -57,10 +57,7 @@ class ProductsPage extends ConsumerWidget {
backgroundColor: AppColors.danger, backgroundColor: AppColors.danger,
textColor: AppColors.white, textColor: AppColors.white,
isLabelVisible: cartItemCount > 0, isLabelVisible: cartItemCount > 0,
child: const Icon( child: const Icon(Icons.shopping_cart_outlined, color: Colors.black),
Icons.shopping_cart_outlined,
color: Colors.black,
),
), ),
onPressed: () => context.push(RouteNames.cart), onPressed: () => context.push(RouteNames.cart),
), ),
@@ -77,9 +74,7 @@ class ProductsPage extends ConsumerWidget {
child: Row( child: Row(
children: [ children: [
// Search Bar (Expanded) // Search Bar (Expanded)
const Expanded( const Expanded(child: ProductSearchBar()),
child: ProductSearchBar(),
),
const SizedBox(width: 8), const SizedBox(width: 8),
// Filter Button // Filter Button
SizedBox( SizedBox(
@@ -90,25 +85,14 @@ class ProductsPage extends ConsumerWidget {
Scaffold.of(scaffoldContext).openEndDrawer(); Scaffold.of(scaffoldContext).openEndDrawer();
}, },
icon: const Icon(Icons.filter_list, size: 20), icon: const Icon(Icons.filter_list, size: 20),
label: const Text( label: const Text('Lọc', style: TextStyle(fontSize: 12)),
'Lọc',
style: TextStyle(fontSize: 12),
),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
foregroundColor: AppColors.grey900, foregroundColor: AppColors.grey900,
side: const BorderSide( side: const BorderSide(color: AppColors.white, width: 0),
color: AppColors.white,
width: 0,
),
backgroundColor: AppColors.white, backgroundColor: AppColors.white,
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
horizontal: 12,
vertical: 8,
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(InputFieldSpecs.borderRadius),
InputFieldSpecs.borderRadius,
),
), ),
), ),
), ),
@@ -117,15 +101,13 @@ class ProductsPage extends ConsumerWidget {
), ),
), ),
// Category Filter Chips // Category Filter Chips
categoriesAsync.when( categoriesAsync.when(
data: (categories) => CategoryFilterChips(categories: categories), data: (categories) => CategoryFilterChips(categories: categories),
loading: () => const SizedBox( loading: () =>
height: 48.0, const SizedBox(height: 48.0, child: Center(child: CircularProgressIndicator(strokeWidth: 2.0))),
child: Center(child: CircularProgressIndicator(strokeWidth: 2.0)), error: (error, stack) => const SizedBox.shrink(),
), ),
error: (error, stack) => const SizedBox.shrink(),
),
const SizedBox(height: AppSpacing.sm), const SizedBox(height: AppSpacing.sm),
@@ -149,21 +131,16 @@ class ProductsPage extends ConsumerWidget {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: content: Text('${product.name} đã thêm vào giỏ hàng'),
Text('${product.name} đã thêm vào giỏ hàng'),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
action: SnackBarAction( action: SnackBarAction(label: 'Xem', onPressed: () => context.go(RouteNames.cart)),
label: 'Xem',
onPressed: () => context.go(RouteNames.cart),
),
), ),
); );
}, },
); );
}, },
loading: () => _buildLoadingState(), loading: () => _buildLoadingState(),
error: (error, stack) => error: (error, stack) => _buildErrorState(context, l10n, error, ref),
_buildErrorState(context, l10n, error, ref),
), ),
), ),
], ],
@@ -179,25 +156,14 @@ class ProductsPage extends ConsumerWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Icon(Icons.inventory_2_outlined, size: 80.0, color: AppColors.grey500.withAlpha(128)),
Icons.inventory_2_outlined,
size: 80.0,
color: AppColors.grey500.withAlpha(128),
),
const SizedBox(height: AppSpacing.lg), const SizedBox(height: AppSpacing.lg),
Text( Text(
l10n.noProductsFound, l10n.noProductsFound,
style: const TextStyle( style: const TextStyle(fontSize: 18.0, fontWeight: FontWeight.w500, color: AppColors.grey900),
fontSize: 18.0,
fontWeight: FontWeight.w500,
color: AppColors.grey900,
),
), ),
const SizedBox(height: AppSpacing.sm), const SizedBox(height: AppSpacing.sm),
Text( Text(l10n.noResults, style: const TextStyle(fontSize: 14.0, color: AppColors.grey500)),
l10n.noResults,
style: const TextStyle(fontSize: 14.0, color: AppColors.grey500),
),
], ],
), ),
); );
@@ -205,37 +171,22 @@ class ProductsPage extends ConsumerWidget {
/// Build loading state /// Build loading state
Widget _buildLoadingState() { Widget _buildLoadingState() {
return const Center( return const Center(child: CircularProgressIndicator(color: AppColors.primaryBlue));
child: CircularProgressIndicator(color: AppColors.primaryBlue),
);
} }
/// Build error state /// Build error state
Widget _buildErrorState( Widget _buildErrorState(BuildContext context, AppLocalizations l10n, Object error, WidgetRef ref) {
BuildContext context,
AppLocalizations l10n,
Object error,
WidgetRef ref,
) {
return Center( return Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(AppSpacing.xl), padding: const EdgeInsets.all(AppSpacing.xl),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Icon(Icons.error_outline, size: 80.0, color: AppColors.danger.withAlpha(128)),
Icons.error_outline,
size: 80.0,
color: AppColors.danger.withAlpha(128),
),
const SizedBox(height: AppSpacing.lg), const SizedBox(height: AppSpacing.lg),
Text( Text(
l10n.error, l10n.error,
style: const TextStyle( style: const TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600, color: AppColors.grey900),
fontSize: 18.0,
fontWeight: FontWeight.w600,
color: AppColors.grey900,
),
), ),
const SizedBox(height: AppSpacing.sm), const SizedBox(height: AppSpacing.sm),
Text( Text(
@@ -253,10 +204,7 @@ class ProductsPage extends ConsumerWidget {
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryBlue, backgroundColor: AppColors.primaryBlue,
foregroundColor: AppColors.white, foregroundColor: AppColors.white,
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: AppSpacing.lg, vertical: AppSpacing.md),
horizontal: AppSpacing.lg,
vertical: AppSpacing.md,
),
), ),
), ),
], ],

View File

@@ -42,6 +42,7 @@ class ProductCard extends ConsumerWidget {
return Card( return Card(
elevation: ProductCardSpecs.elevation, elevation: ProductCardSpecs.elevation,
margin: const EdgeInsets.all(8),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(ProductCardSpecs.borderRadius), borderRadius: BorderRadius.circular(ProductCardSpecs.borderRadius),
), ),

View File

@@ -153,6 +153,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" 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: characters:
dependency: transitive dependency: transitive
description: description:

View File

@@ -73,6 +73,7 @@ dependencies:
shared_preferences: ^2.2.3 shared_preferences: ^2.2.3
flutter_secure_storage: ^9.2.4 flutter_secure_storage: ^9.2.4
# Navigation # Navigation
go_router: ^14.6.2 go_router: ^14.6.2
@@ -94,6 +95,7 @@ dev_dependencies:
# Linting # Linting
flutter_lints: ^5.0.0 flutter_lints: ^5.0.0
change_app_package_name: ^1.5.0
# Testing # Testing
mockito: ^5.4.4 mockito: ^5.4.4