Files
worker/lib/features/promotions/presentation/widgets/highlight_box.dart
2025-10-24 14:42:14 +07:00

63 lines
1.6 KiB
Dart

/// Highlight Box Widget
///
/// A highlighted box with gradient background used to emphasize
/// important information in promotion details.
library;
import 'package:flutter/material.dart';
/// Highlight Box Widget
///
/// Displays important promotion information with:
/// - Yellow/orange gradient background
/// - Border styling
/// - Centered text
/// - Optional emoji/icon
class HighlightBox extends StatelessWidget {
const HighlightBox({
required this.text,
this.emoji,
super.key,
});
/// Text to display in the highlight box
final String text;
/// Optional emoji or icon to display before text
final String? emoji;
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
margin: const EdgeInsets.symmetric(vertical: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFEF3C7), // #fef3c7
Color(0xFFFED7AA), // #fed7aa
],
),
border: Border.all(
color: const Color(0xFFFBBF24), // #fbbf24
width: 1,
),
borderRadius: BorderRadius.circular(12),
),
child: Text(
emoji != null ? '$emoji $text' : text,
textAlign: TextAlign.center,
style: const TextStyle(
color: Color(0xFF92400E), // #92400e - brown color
fontSize: 15,
fontWeight: FontWeight.w600,
height: 1.5,
),
),
);
}
}