Update: 2026-06-27 04:21:17
This commit is contained in:
@@ -450,36 +450,83 @@ class RegistrationView extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
height: 150,
|
||||
width: double.infinity,
|
||||
child: (img != null && img.isNotEmpty)
|
||||
? Image.network(
|
||||
img,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.broken_image, size: 40, color: Colors.red),
|
||||
const SizedBox(height: 8),
|
||||
Text('Image not available',
|
||||
style: TextStyle(color: Colors.red[700])),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.camera_alt_outlined,
|
||||
size: 40, color: Colors.grey[600]),
|
||||
const SizedBox(height: 8),
|
||||
Text(title, style: TextStyle(color: Colors.grey[700])),
|
||||
Text('Tap to upload'.tr,
|
||||
style:
|
||||
const TextStyle(color: Colors.grey, fontSize: 12)),
|
||||
],
|
||||
child: Stack(
|
||||
children: [
|
||||
// Card template background
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[100],
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
color: Colors.grey[300]!,
|
||||
width: 1.5,
|
||||
strokeAlign: BorderSide.strokeAlignInside,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.credit_card, size: 48, color: Colors.grey[300]),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[400],
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Uploaded image with 50% opacity
|
||||
if (img != null && img.isNotEmpty)
|
||||
Positioned.fill(
|
||||
child: Opacity(
|
||||
opacity: 0.5,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Image.network(
|
||||
img,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.broken_image, size: 40, color: Colors.red),
|
||||
const SizedBox(height: 8),
|
||||
Text('Image not available',
|
||||
style: TextStyle(color: Colors.red[700])),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Empty state with camera icon
|
||||
if (img == null || img.isEmpty)
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.camera_alt_outlined,
|
||||
size: 40, color: Colors.grey[600]),
|
||||
const SizedBox(height: 8),
|
||||
Text('Tap to upload'.tr,
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user