oc-front/lib/widgets/dialog/alert.dart

63 lines
1.7 KiB
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
2024-11-08 13:59:22 +01:00
import 'package:oc_front/main.dart';
class InfoAlertBannerChild extends StatelessWidget {
final String text;
const InfoAlertBannerChild({super.key, required this.text});
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
2024-11-08 13:59:22 +01:00
constraints: BoxConstraints(maxWidth: getMainWidth(context) * 0.8),
decoration: const BoxDecoration(
color: Colors.greenAccent,
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Padding(
padding: const EdgeInsets.all(10),
child: Material(
color: Colors.transparent,
child: Text(text,
style: const TextStyle(color: Colors.white, fontSize: 18),
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
),
);
}
}
class AlertAlertBannerChild extends StatelessWidget {
final String text;
const AlertAlertBannerChild({super.key, required this.text});
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
2024-11-08 13:59:22 +01:00
constraints: BoxConstraints(maxWidth: getMainWidth(context) * 0.8),
decoration: BoxDecoration(
color: redColor,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Padding(
padding: const EdgeInsets.all(10),
child: Material(
color: Colors.transparent,
child: Text( text,
style: const TextStyle(color: Colors.white, fontSize: 18),
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
),
);
}
}