diff --git a/docs/review.sh b/docs/review.sh new file mode 100644 index 0000000..18ef0cf --- /dev/null +++ b/docs/review.sh @@ -0,0 +1,32 @@ +# create review +curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.item_feedback.update' \ +--header 'Cookie: sid=a0c9a51c8d1fbbec824283115094bdca939bb829345e0005334aa99f; full_name=Ha%20Duy%20Lam; sid=42ab54811fb7eadc8c67a6651c68519c8655e9b3e7b797628dcd0b88; system_user=yes; user_id=lamhd%40gmail.com; user_image=' \ +--header 'X-Frappe-Csrf-Token: a22fa53eeaa923f71f2fd879d2863a0985a6f2107f5f7f66d34cd62d' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "item_id": "Gạch ốp Signature SIG.P-8806", + "rating" : 0.5, + "comment" : "Good job 2", + "name" : "ITEM-Gạch ốp Signature SIG.P-8806-tiennld6@dbiz.com" +}' + + +# delete review +curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.item_feedback.delete' \ +--header 'Cookie: sid=a0c9a51c8d1fbbec824283115094bdca939bb829345e0005334aa99f; full_name=Ha%20Duy%20Lam; sid=42ab54811fb7eadc8c67a6651c68519c8655e9b3e7b797628dcd0b88; system_user=yes; user_id=lamhd%40gmail.com; user_image=' \ +--header 'X-Frappe-Csrf-Token: a22fa53eeaa923f71f2fd879d2863a0985a6f2107f5f7f66d34cd62d' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "name" : "ITEM-Gạch ốp Signature SIG.P-8806-tiennld6@dbiz.com" +}' + +#get list review +curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.item_feedback.get_list' \ +--header 'Cookie: sid=a0c9a51c8d1fbbec824283115094bdca939bb829345e0005334aa99f; full_name=Ha%20Duy%20Lam; sid=42ab54811fb7eadc8c67a6651c68519c8655e9b3e7b797628dcd0b88; system_user=yes; user_id=lamhd%40gmail.com; user_image=' \ +--header 'X-Frappe-Csrf-Token: a22fa53eeaa923f71f2fd879d2863a0985a6f2107f5f7f66d34cd62d' \ +--header 'Content-Type: application/json' \ +--data '{ + "limit_page_length" : 10, + "limit_start" : 0, + "item_id" : "GIB20 G04" +}' \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4c1fe32..50c9196 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -491,6 +491,7 @@ DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "DBIZ Partner"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -674,6 +675,7 @@ DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "DBIZ Partner"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -697,6 +699,7 @@ DEVELOPMENT_TEAM = 9R5X2DM2C8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "DBIZ Partner"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/lib/features/products/presentation/widgets/product_detail/image_gallery_section.dart b/lib/features/products/presentation/widgets/product_detail/image_gallery_section.dart index 9126e53..38274a5 100644 --- a/lib/features/products/presentation/widgets/product_detail/image_gallery_section.dart +++ b/lib/features/products/presentation/widgets/product_detail/image_gallery_section.dart @@ -19,9 +19,9 @@ import 'package:worker/features/products/domain/entities/product.dart'; /// - Image indicators (dots) /// - Thumbnail gallery row (horizontal scroll) class ImageGallerySection extends StatefulWidget { - final Product product; const ImageGallerySection({super.key, required this.product}); + final Product product; @override State createState() => _ImageGallerySectionState(); @@ -203,48 +203,78 @@ class _ImageGallerySectionState extends State { // Thumbnail Gallery if (images.length > 1) Container( - height: 92, padding: const EdgeInsets.all(16), - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: images.length, - itemBuilder: (context, index) { - final isActive = _currentImageIndex == index; - return GestureDetector( - onTap: () => _changeImage(index), - child: Container( - width: 60, - height: 60, - margin: const EdgeInsets.only(right: 12), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: isActive - ? AppColors.primaryBlue - : Colors.transparent, - width: 2, - ), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: CachedNetworkImage( - imageUrl: images[index], - fit: BoxFit.cover, - placeholder: (context, url) => - Container(color: AppColors.grey100), - errorWidget: (context, url, error) => Container( - color: AppColors.grey100, - child: const Icon( - FontAwesomeIcons.image, - size: 20, - color: AppColors.grey500, + child: SizedBox( + height: 80, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: images.length, + itemBuilder: (context, index) { + final isActive = _currentImageIndex == index; + final imageUrl = images[index]; + final imageName = widget.product.imageCaptions[imageUrl]; + + return GestureDetector( + onTap: () => _changeImage(index), + child: Container( + margin: const EdgeInsets.only(right: 12), + child: Column( + mainAxisSize: .min, + mainAxisAlignment: .end, + children: [ + // Image name above thumbnail (only show for active/selected) + if (isActive && imageName != null && imageName.isNotEmpty) + Padding( + padding: const EdgeInsets.only(bottom: 4), + child: Text( + imageName, + style: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: AppColors.primaryBlue, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + + // Thumbnail image + Container( + width: 60, + height: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: isActive + ? AppColors.primaryBlue + : Colors.transparent, + width: 2, + ), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(6), + child: CachedNetworkImage( + imageUrl: imageUrl, + fit: BoxFit.cover, + placeholder: (context, url) => + Container(color: AppColors.grey100), + errorWidget: (context, url, error) => Container( + color: AppColors.grey100, + child: const Icon( + FontAwesomeIcons.image, + size: 20, + color: AppColors.grey500, + ), + ), + ), + ), ), - ), + ], ), ), - ), - ); - }, + ); + }, + ), ), ), ], @@ -255,15 +285,15 @@ class _ImageGallerySectionState extends State { /// Image Lightbox for full-screen image viewing class _ImageLightbox extends StatefulWidget { - final List images; - final Map imageCaptions; - final int initialIndex; const _ImageLightbox({ required this.images, required this.imageCaptions, required this.initialIndex, }); + final List images; + final Map imageCaptions; + final int initialIndex; @override State<_ImageLightbox> createState() => _ImageLightboxState(); diff --git a/pubspec.lock b/pubspec.lock index e7a50da..ce47191 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -912,10 +912,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: @@ -1437,26 +1437,26 @@ packages: dependency: transitive description: name: test - sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb" + sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" url: "https://pub.dev" source: hosted - version: "1.26.2" + version: "1.26.3" test_api: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.7" test_core: dependency: transitive description: name: test_core - sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a" + sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" url: "https://pub.dev" source: hosted - version: "0.6.11" + version: "0.6.12" timing: dependency: transitive description: @@ -1650,5 +1650,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=3.9.2 <4.0.0" + dart: ">=3.10.0 <4.0.0" flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index d38f7dc..1bf795f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,10 +16,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+3 +version: 1.0.0+4 environment: - sdk: ^3.9.2 + sdk: ^3.10.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions