flutter_app/lib/widgets/malformedbubble.dart

55 lines
2.1 KiB
Dart
Raw Normal View History

2021-06-03 18:32:25 +00:00
import 'package:cwtch/cwtch_icons_icons.dart';
2021-05-12 22:39:10 +00:00
import 'package:flutter/material.dart';
2021-06-15 00:38:07 +00:00
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
2021-05-12 22:39:10 +00:00
final Color malformedColor = Color(0xFFE85DA1);
// MalformedBubble is displayed in the case of a malformed message
class MalformedBubble extends StatefulWidget {
@override
MalformedBubbleState createState() => MalformedBubbleState();
}
class MalformedBubbleState extends State<MalformedBubble> {
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return Center(
widthFactor: 1.0,
child: Container(
decoration: BoxDecoration(
color: malformedColor,
border: Border.all(color: malformedColor, width: 1),
borderRadius: BorderRadius.only(
topLeft: Radius.zero,
topRight: Radius.zero,
bottomLeft: Radius.zero,
bottomRight: Radius.zero,
),
),
child: Center(
widthFactor: 1.0,
child: Padding(
padding: EdgeInsets.all(9.0),
child: Row(mainAxisSize: MainAxisSize.min, children: [
Center(
widthFactor: 1,
child: Padding(
padding: EdgeInsets.all(4),
2021-06-03 18:32:25 +00:00
child: Icon(
CwtchIcons.favorite_black_24dp_broken,
2021-06-04 18:13:52 +00:00
size: 24,
2021-06-03 18:32:25 +00:00
))),
2021-05-12 22:39:10 +00:00
Center(
widthFactor: 1.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
2021-06-15 00:38:07 +00:00
children: [Text(AppLocalizations.of(context)!.malformedMessage)],
2021-05-12 22:39:10 +00:00
))
])))));
});
}
}