Files
apskel-pos-flutter-v2/lib/presentation/components/card/error_card.dart
T

48 lines
1.2 KiB
Dart
Raw Normal View History

2025-10-25 00:13:43 +07:00
import 'package:flutter/material.dart';
import '../button/button.dart';
class ErrorCard extends StatelessWidget {
final String title;
final String message;
final Function() onTap;
const ErrorCard({
super.key,
required this.title,
required this.message,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.error_outline, size: 48, color: Colors.red.shade400),
2026-03-01 20:02:12 +07:00
const SizedBox(height: 16),
2025-10-25 00:13:43 +07:00
Text(
title,
2026-03-01 20:02:12 +07:00
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
2025-10-25 00:13:43 +07:00
),
2026-03-01 20:02:12 +07:00
const SizedBox(height: 8),
2025-10-25 00:13:43 +07:00
Padding(
2026-03-01 20:02:12 +07:00
padding: const EdgeInsets.symmetric(horizontal: 32),
2025-10-25 00:13:43 +07:00
child: Text(
message,
textAlign: TextAlign.center,
2026-03-01 20:02:12 +07:00
style: const TextStyle(color: Colors.grey),
2025-10-25 00:13:43 +07:00
),
),
2026-03-01 20:02:12 +07:00
const SizedBox(height: 16),
2025-10-25 00:13:43 +07:00
AppElevatedButton.filled(
width: 120,
onPressed: onTap,
label: 'Coba Lagi',
),
],
),
);
}
}