Line data Source code
1 : import 'package:cwtch/cwtch_icons_icons.dart';
2 : import 'package:flutter/material.dart';
3 : import 'package:cwtch/l10n/app_localizations.dart';
4 : import 'package:provider/provider.dart';
5 :
6 : import '../settings.dart';
7 : import '../themes/opaque.dart';
8 :
9 : // HiddenBubble is displayed for messages hidden by a moderator
10 : class DeletedBubble extends StatefulWidget {
11 0 : @override
12 0 : DeletedBubbleState createState() => DeletedBubbleState();
13 : }
14 :
15 : class DeletedBubbleState extends State<DeletedBubble> {
16 0 : @override
17 : Widget build(BuildContext context) {
18 0 : return Container(
19 0 : decoration: BoxDecoration(
20 0 : color: Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
21 0 : border: Border.all(color: Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
22 0 : borderRadius: BorderRadius.only(topLeft: Radius.zero, topRight: Radius.zero, bottomLeft: Radius.zero, bottomRight: Radius.zero),
23 : ),
24 0 : constraints: BoxConstraints.loose(MediaQuery.sizeOf(context)),
25 0 : child: FittedBox(
26 : fit: BoxFit.contain,
27 0 : child: Center(
28 : widthFactor: 1.0,
29 0 : child: Padding(
30 0 : padding: EdgeInsets.all(9.0),
31 0 : child: Row(
32 : mainAxisSize: MainAxisSize.min,
33 0 : children: [
34 0 : Center(
35 : widthFactor: 1,
36 0 : child: Padding(
37 0 : padding: EdgeInsets.all(4),
38 0 : child: Icon(CwtchIcons.delete_24px, size: 24, color: Provider.of<Settings>(context).current().mainTextColor),
39 : ),
40 : ),
41 0 : Center(
42 : widthFactor: 1.0,
43 0 : child: Text(
44 0 : AppLocalizations.of(context)!.messageDeleted,
45 : maxLines: 3,
46 0 : style: defaultMessageTextStyle.copyWith(overflow: TextOverflow.ellipsis),
47 : overflow: TextOverflow.ellipsis,
48 : textWidthBasis: TextWidthBasis.parent,
49 : ),
50 : ),
51 : ],
52 : ),
53 : ),
54 : ),
55 : ),
56 : );
57 : }
58 : }
|