Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d48f9f4bd0 |
@@ -130,7 +130,7 @@ class _PublicProductScreenState extends State<PublicProductScreen> {
|
||||
slivers: [
|
||||
// 1. Gallery
|
||||
SliverToBoxAdapter(
|
||||
child: _HeroGallery(imageUrls: imageUrls),
|
||||
child: _HeroGallery(imageUrls: imageUrls, shopName: shop?['name'] as String? ?? ''),
|
||||
),
|
||||
// 2. Verified ribbon
|
||||
SliverToBoxAdapter(
|
||||
@@ -227,7 +227,8 @@ class _PublicProductScreenState extends State<PublicProductScreen> {
|
||||
|
||||
class _HeroGallery extends StatefulWidget {
|
||||
final List<String> imageUrls;
|
||||
const _HeroGallery({required this.imageUrls});
|
||||
final String shopName;
|
||||
const _HeroGallery({required this.imageUrls, this.shopName = ''});
|
||||
|
||||
@override
|
||||
State<_HeroGallery> createState() => _HeroGalleryState();
|
||||
@@ -280,7 +281,7 @@ class _HeroGalleryState extends State<_HeroGallery> {
|
||||
),
|
||||
// Image or placeholder
|
||||
if (urls.isEmpty)
|
||||
_EmptyGalleryContent()
|
||||
_EmptyGalleryContent(shopName: widget.shopName)
|
||||
else
|
||||
PageView.builder(
|
||||
controller: _ctrl,
|
||||
@@ -291,7 +292,7 @@ class _HeroGalleryState extends State<_HeroGallery> {
|
||||
child: Image.network(
|
||||
urls[i],
|
||||
fit: BoxFit.contain,
|
||||
errorBuilder: (_, __, ___) => _EmptyGalleryContent(),
|
||||
errorBuilder: (_, __, ___) => _EmptyGalleryContent(shopName: widget.shopName),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -409,8 +410,12 @@ class _HeroGalleryState extends State<_HeroGallery> {
|
||||
}
|
||||
|
||||
class _EmptyGalleryContent extends StatelessWidget {
|
||||
final String shopName;
|
||||
const _EmptyGalleryContent({this.shopName = ''});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final initial = shopName.isNotEmpty ? shopName.characters.first : '店';
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -421,9 +426,9 @@ class _EmptyGalleryContent extends StatelessWidget {
|
||||
color: const Color(0xFF0F3057),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text('岩美',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 18, fontWeight: FontWeight.w700)),
|
||||
child: Center(
|
||||
child: Text(initial,
|
||||
style: const TextStyle(color: Colors.white70, fontSize: 28, fontWeight: FontWeight.w700)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Reference in New Issue
Block a user