LCOV - code coverage report
Current view: top level - lib/widgets - messagebubbledecorations.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 28 0.0 %
Date: 2026-07-15 19:28:30 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:flutter/material.dart';
       2             : import 'package:provider/provider.dart';
       3             : import '../models/redaction.dart';
       4             : import '../settings.dart';
       5             : import 'package:cwtch/l10n/app_localizations.dart';
       6             : 
       7             : // Provides message decorations (acks/errors/dates etc.) for generic message bubble overlays (chats, invites etc.)
       8             : class MessageBubbleDecoration extends StatefulWidget {
       9           0 :   MessageBubbleDecoration({required this.ackd, required this.errored, required this.messageDate, required this.fromMe});
      10             :   final DateTime messageDate;
      11             :   final bool fromMe;
      12             :   final bool ackd;
      13             :   final bool errored;
      14             : 
      15           0 :   @override
      16           0 :   _MessageBubbleDecoration createState() => _MessageBubbleDecoration();
      17             : }
      18             : 
      19             : class _MessageBubbleDecoration extends State<MessageBubbleDecoration> {
      20           0 :   @override
      21             :   Widget build(BuildContext context) {
      22           0 :     var prettyDate = prettyDateString(context, widget.messageDate.toLocal());
      23             : 
      24           0 :     return FittedBox(
      25           0 :       child: Row(
      26             :         mainAxisSize: MainAxisSize.min,
      27           0 :         children: [
      28           0 :           Text(
      29             :             prettyDate,
      30             :             overflow: TextOverflow.ellipsis,
      31             :             textWidthBasis: TextWidthBasis.longestLine,
      32           0 :             style: TextStyle(
      33           0 :               fontSize: 9.0 * Provider.of<Settings>(context).fontScaling,
      34             :               fontWeight: FontWeight.w200,
      35             :               fontFamily: "Inter",
      36           0 :               color: widget.fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor,
      37             :             ),
      38           0 :             textAlign: widget.fromMe ? TextAlign.right : TextAlign.left,
      39             :           ),
      40           0 :           !widget.fromMe
      41           0 :               ? SizedBox(width: 1, height: 1)
      42           0 :               : Padding(
      43           0 :                   padding: EdgeInsets.all(1.0),
      44           0 :                   child: widget.ackd == true
      45           0 :                       ? Tooltip(
      46           0 :                           message: AppLocalizations.of(context)!.acknowledgedLabel,
      47           0 :                           child: Icon(Icons.check_circle_outline, color: Provider.of<Settings>(context).theme.messageFromMeTextColor, size: 16),
      48             :                         )
      49           0 :                       : (widget.errored == true
      50           0 :                             ? Tooltip(
      51           0 :                                 message: AppLocalizations.of(context)!.couldNotSendMsgError,
      52           0 :                                 child: Icon(Icons.error_outline, color: Provider.of<Settings>(context).theme.messageFromMeTextColor, size: 16),
      53             :                               )
      54           0 :                             : Tooltip(
      55           0 :                                 message: AppLocalizations.of(context)!.pendingLabel,
      56           0 :                                 child: Icon(Icons.hourglass_bottom_outlined, color: Provider.of<Settings>(context).theme.messageFromMeTextColor, size: 16),
      57             :                               )),
      58             :                 ),
      59             :         ],
      60             :       ),
      61             :     );
      62             :   }
      63             : }

Generated by: LCOV version 1.14