LCOV - code coverage report
Current view: top level - lib/widgets - messageBubbleWidgetHelpers.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 23 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 '../controllers/open_link_modal.dart';
       4             : import '../settings.dart';
       5             : import '../themes/opaque.dart';
       6             : import '../third_party/linkify/flutter_linkify.dart';
       7             : 
       8           0 : Widget compileSenderWidget(BuildContext context, BoxConstraints? constraints, bool fromMe, String senderDisplayStr) {
       9           0 :   return Container(
      10           0 :     height: 14 * Provider.of<Settings>(context).fontScaling,
      11             :     clipBehavior: Clip.hardEdge,
      12           0 :     decoration: BoxDecoration(),
      13           0 :     child: SelectableText(
      14             :       senderDisplayStr,
      15             :       maxLines: 1,
      16           0 :       style: TextStyle(
      17           0 :         fontSize: 9.0 * Provider.of<Settings>(context).fontScaling,
      18             :         fontWeight: FontWeight.bold,
      19             :         fontFamily: "Inter",
      20             :         overflow: TextOverflow.clip,
      21           0 :         color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor,
      22             :       ),
      23             :     ),
      24             :   );
      25             : }
      26             : 
      27           0 : Widget compileMessageContentWidget(BuildContext context, BoxConstraints constraints, fromMe, String content, FocusNode focus, bool formatMessages, bool showClickableLinks) {
      28           0 :   return SelectableLinkify(
      29           0 :     text: content + '\u202F',
      30             :     // TODO: onOpen breaks the "selectable" functionality. Maybe something to do with gesture handler?
      31           0 :     options: LinkifyOptions(messageFormatting: formatMessages, parseLinks: showClickableLinks, looseUrl: true, defaultToHttps: true),
      32           0 :     linkifiers: [UrlLinkifier()],
      33             :     onOpen: showClickableLinks
      34           0 :         ? (link) {
      35           0 :             modalOpenLink(context, link);
      36             :           }
      37             :         : null,
      38             :     focusNode: focus,
      39           0 :     style: Provider.of<Settings>(
      40             :       context,
      41           0 :     ).scaleFonts(defaultMessageTextStyle.copyWith(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor)),
      42           0 :     linkStyle: Provider.of<Settings>(
      43             :       context,
      44           0 :     ).scaleFonts(defaultMessageTextStyle.copyWith(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor)),
      45           0 :     codeStyle: Provider.of<Settings>(context).scaleFonts(
      46           0 :       defaultMessageTextStyle.copyWith(
      47             :         fontFamily: "RobotoMono",
      48           0 :         color: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherTextColor : Provider.of<Settings>(context).theme.messageFromMeTextColor,
      49           0 :         backgroundColor: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor : Provider.of<Settings>(context).theme.messageFromMeBackgroundColor,
      50             :       ),
      51             :     ),
      52             :     textAlign: TextAlign.left,
      53             :     constraints: constraints,
      54             :     textWidthBasis: TextWidthBasis.longestLine,
      55             :   );
      56             : }

Generated by: LCOV version 1.14