import 'package:flutter/material.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, constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 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, constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.8), decoration: const BoxDecoration( color: Colors.redAccent, 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, ), ), ), ); } }