43 lines
1.1 KiB
Dart
43 lines
1.1 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
import '../../core/theme/design_tokens.dart';
|
||
|
|
|
||
|
|
class WarningBanner extends StatelessWidget {
|
||
|
|
final String message;
|
||
|
|
final bool visible;
|
||
|
|
|
||
|
|
const WarningBanner({super.key, required this.message, this.visible = true});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
if (!visible) return const SizedBox.shrink();
|
||
|
|
|
||
|
|
return Container(
|
||
|
|
width: double.infinity,
|
||
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: AppColors.warningBackground,
|
||
|
|
borderRadius: BorderRadius.circular(AppRadius.sm),
|
||
|
|
),
|
||
|
|
child: Row(
|
||
|
|
children: [
|
||
|
|
const Icon(
|
||
|
|
Icons.warning_amber_rounded,
|
||
|
|
size: 16,
|
||
|
|
color: AppColors.warningText,
|
||
|
|
),
|
||
|
|
const SizedBox(width: 8),
|
||
|
|
Expanded(
|
||
|
|
child: Text(
|
||
|
|
message,
|
||
|
|
style: const TextStyle(
|
||
|
|
fontSize: 13,
|
||
|
|
color: AppColors.warningText,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|