LCOV - code coverage report
Current view: top level - lib/widgets - hiddenbubble.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 33 0.0 %
Date: 2026-09-01 20:32:38 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:cwtch/cwtch_icons_icons.dart';
       2             : import 'package:cwtch/models/messagecache.dart';
       3             : import 'package:cwtch/models/contact.dart';
       4             : import 'package:cwtch/models/profile.dart';
       5             : import 'package:cwtch/l10n/app_localizations.dart';
       6             : import 'package:provider/provider.dart';
       7             : import 'package:flutter/material.dart';
       8             : 
       9             : import '../settings.dart';
      10             : import '../models/message.dart';
      11             : import '../themes/opaque.dart';
      12             : 
      13             : // HiddenBubble is displayed for messages hidden by a moderator
      14             : class HiddenBubble extends StatefulWidget {
      15             :   final MessageInfo messageInfo;
      16             : 
      17           0 :   HiddenBubble(this.messageInfo);
      18             : 
      19           0 :   @override
      20           0 :   HiddenBubbleState createState() => HiddenBubbleState();
      21             : }
      22             : 
      23             : class HiddenBubbleState extends State<HiddenBubble> {
      24           0 :   @override
      25             :   Widget build(BuildContext context) {
      26           0 :     var profile = Provider.of<ProfileInfoState>(context, listen: false);
      27           0 :     var conversation = Provider.of<ContactInfoState>(context);
      28           0 :     bool couldMod = ['admin', 'op', 'mod'].contains(conversation.getRole(profile.onion));
      29             : 
      30           0 :     return Container(
      31           0 :       decoration: BoxDecoration(
      32           0 :         color: Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
      33           0 :         border: Border.all(color: Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
      34           0 :         borderRadius: BorderRadius.only(topLeft: Radius.zero, topRight: Radius.zero, bottomLeft: Radius.zero, bottomRight: Radius.zero),
      35             :       ),
      36           0 :       child: FittedBox(
      37             :         fit: BoxFit.contain,
      38           0 :         child: Center(
      39             :           widthFactor: 1.0,
      40           0 :           child: Padding(
      41           0 :             padding: EdgeInsets.all(9.0),
      42           0 :             child: Row(
      43             :               mainAxisSize: MainAxisSize.min,
      44           0 :               children: [
      45           0 :                 Center(
      46             :                   widthFactor: 1,
      47           0 :                   child: Padding(
      48           0 :                     padding: EdgeInsets.all(4),
      49           0 :                     child: Icon(CwtchIcons.eye_closed, size: 24, color: Provider.of<Settings>(context).current().mainTextColor),
      50             :                   ),
      51             :                 ),
      52           0 :                 Center(
      53             :                   widthFactor: 1.0,
      54           0 :                   child: Text(
      55           0 :                     AppLocalizations.of(context)!.messageHidden,
      56           0 :                     style: Provider.of<Settings>(context).scaleFonts(defaultMessageTextStyle),
      57             :                     overflow: TextOverflow.ellipsis,
      58             :                     textWidthBasis: TextWidthBasis.longestLine,
      59             :                   ),
      60             :                 ),
      61           0 :                 Visibility(
      62             :                   visible: couldMod,
      63           0 :                   child: IconButton(
      64             :                     enableFeedback: true,
      65           0 :                     splashRadius: Material.defaultSplashRadius / 2,
      66           0 :                     tooltip: AppLocalizations.of(context)!.buttonMessagePreview,
      67           0 :                     icon: Icon(Icons.preview, color: Provider.of<Settings>(context).current().mainTextColor),
      68           0 :                     onPressed: () {
      69           0 :                       modalPreviewMessage(context, widget.messageInfo);
      70             :                     },
      71             :                   ),
      72             :                 ),
      73             :               ],
      74             :             ),
      75             :           ),
      76             :         ),
      77             :       ),
      78             :     );
      79             :   }
      80             : }

Generated by: LCOV version 1.14