MIF_E31222656/lib/screens/community/components/empty_state.dart

77 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
class EmptyStateWidget extends StatelessWidget {
final VoidCallback onTap;
const EmptyStateWidget({
Key? key,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.green.withOpacity(0.1),
shape: BoxShape.circle,
),
child: Icon(
Icons.chat_bubble_outline,
size: 60,
color: Colors.green.shade700,
),
),
const SizedBox(height: 24),
Text(
'Belum ada pesan',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.grey[800],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Text(
'Mulai percakapan dengan komunitas petani lainnya',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.grey[600],
),
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: onTap,
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF00A884),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
),
),
child: const Text(
'Refresh',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
],
),
),
);
}
}