MIF_E31231623/android/wisata_app/lib/widgets/placeholder_image_widget.dart

52 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
/// Widget untuk membuat placeholder image dengan warna dan ikon
class PlaceholderImage extends StatelessWidget {
final String name;
final Color color;
final IconData icon;
const PlaceholderImage({
super.key,
required this.name,
required this.color,
required this.icon,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
color.withValues(alpha: 0.9),
color.withValues(alpha: 0.6),
],
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
color: Colors.white.withValues(alpha: 0.8),
size: 80,
),
const SizedBox(height: 16),
Text(
name,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
],
),
);
}
}