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(padding: EdgeInsets.all(4), child: Icon(CwtchIcons.delete_24px, size: 24)), 37 : ), 38 0 : Center( 39 : widthFactor: 1.0, 40 0 : child: Text( 41 : "t9n(This message was deleted by a moderator.)", 42 : maxLines: 3, 43 0 : style: defaultMessageTextStyle.copyWith(overflow: TextOverflow.ellipsis), 44 : overflow: TextOverflow.ellipsis, 45 : textWidthBasis: TextWidthBasis.parent, 46 : ), 47 : ), 48 : ], 49 : ), 50 : ), 51 : ), 52 : ), 53 : ); 54 : } 55 : }