You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
1 year ago
|
/*
|
||
|
* Copyright (c) 2023. Open Mobile Platform LLC.
|
||
|
* License: Proprietary.
|
||
|
*/
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_example_packages/theme/radius.dart';
|
||
|
import 'package:flutter_example_packages/widgets/texts/export.dart';
|
||
|
|
||
|
/// Alert
|
||
|
class BlockAlert extends StatelessWidget {
|
||
|
const BlockAlert(
|
||
|
this.text, {
|
||
|
super.key,
|
||
|
this.color = Colors.redAccent,
|
||
|
this.padding = const EdgeInsets.only(bottom: 20),
|
||
|
});
|
||
|
|
||
|
final EdgeInsets padding;
|
||
|
final Color color;
|
||
|
final String? text;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Visibility(
|
||
|
visible: text != null,
|
||
|
child: Padding(
|
||
|
padding: padding,
|
||
|
child: Container(
|
||
|
width: double.infinity,
|
||
|
padding: const EdgeInsets.all(10),
|
||
|
decoration: BoxDecoration(
|
||
|
color: color,
|
||
|
borderRadius: AppRadius.small,
|
||
|
),
|
||
|
child: TextBodyMedium(
|
||
|
'$text',
|
||
|
color: Colors.white,
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|