frosty/lib/widgets/alert_message.dart
Tommy Chow 7be8dcd63f
Add paste button for copied messages and option to move notification to the bottom of chat (#176)
* Add paste button to "message copied" notification

* Add option to move notification to bottom of chat
2022-08-05 22:53:24 -04:00

39 lines
890 B
Dart

import 'package:flutter/material.dart';
/// A simple widget that displays an alert message in the center.
class AlertMessage extends StatelessWidget {
final String message;
final IconData icon;
final Color? color;
const AlertMessage({
Key? key,
required this.message,
final this.icon = Icons.info,
this.color,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
color: color ?? Colors.grey,
),
const SizedBox(width: 5.0),
Flexible(
child: Text(
message,
style: TextStyle(
fontWeight: FontWeight.w500,
color: color ?? Colors.grey,
),
),
),
],
);
}
}