LCOV - code coverage report
Current view: top level - lib/models/messages - textmessage.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 15 0.0 %
Date: 2024-04-05 23:55:39 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:cwtch/models/message.dart';
       2             : import 'package:cwtch/widgets/messagebubble.dart';
       3             : import 'package:cwtch/widgets/messagerow.dart';
       4             : import 'package:flutter/material.dart';
       5             : import 'package:flutter/widgets.dart';
       6             : import 'package:provider/provider.dart';
       7             : 
       8             : import '../../settings.dart';
       9             : import '../../widgets/messageBubbleWidgetHelpers.dart';
      10             : 
      11             : class TextMessage extends Message {
      12             :   final MessageMetadata metadata;
      13             :   final String content;
      14             : 
      15           0 :   TextMessage(this.metadata, this.content);
      16             : 
      17           0 :   @override
      18             :   Widget getPreviewWidget(BuildContext context, {BoxConstraints? constraints}) {
      19           0 :     return ChangeNotifierProvider.value(
      20           0 :         value: this.metadata,
      21           0 :         builder: (bcontext, child) {
      22           0 :           var formatMessages = Provider.of<Settings>(bcontext).isExperimentEnabled(FormattingExperiment);
      23           0 :           return compileMessageContentWidget(context, constraints ?? BoxConstraints.loose(MediaQuery.sizeOf(context)), false, content, FocusNode(), formatMessages, false);
      24             :         });
      25             :   }
      26             : 
      27           0 :   @override
      28             :   MessageMetadata getMetadata() {
      29           0 :     return this.metadata;
      30             :   }
      31             : 
      32           0 :   @override
      33             :   Widget getWidget(BuildContext context, Key key, int index) {
      34           0 :     return ChangeNotifierProvider.value(
      35           0 :         value: this.metadata,
      36           0 :         builder: (bcontext, child) {
      37           0 :           return MessageRow(
      38           0 :             MessageBubble(this.content),
      39             :             index,
      40             :             key: key,
      41             :           );
      42             :         });
      43             :   }
      44             : }

Generated by: LCOV version 1.14