Delete chat_message.dart

This commit is contained in:
tommyxchow 2021-11-12 22:45:07 -05:00
parent a8810e78c2
commit 84e409cf67
2 changed files with 12 additions and 26 deletions

View file

@ -8,7 +8,6 @@ import 'package:frosty/api/seventv_api.dart';
import 'package:frosty/api/twitch_api.dart';
import 'package:frosty/models/irc.dart';
import 'package:frosty/stores/auth_store.dart';
import 'package:frosty/widgets/chat_message.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:mobx/mobx.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
@ -240,9 +239,10 @@ abstract class _ChatStoreBase with Store {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ChatMessage(
key: Key(ircMessage.tags['id']!),
children: span,
Text.rich(
TextSpan(
children: span,
),
),
const SizedBox(height: 5),
banDuration == null
@ -268,9 +268,10 @@ abstract class _ChatStoreBase with Store {
Text(ircMessage.tags['system-msg']!),
const SizedBox(height: 5),
if (ircMessage.message != null)
ChatMessage(
key: Key(ircMessage.tags['id']!),
children: span,
Text.rich(
TextSpan(
children: span,
),
),
],
),
@ -279,9 +280,10 @@ abstract class _ChatStoreBase with Store {
// Render normal chat message (PRIVMSG).
return Padding(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: ChatMessage(
key: ircMessage.tags['id'] == null ? null : Key(ircMessage.tags['id']!),
children: span,
child: Text.rich(
TextSpan(
children: span,
),
),
);
}

View file

@ -1,16 +0,0 @@
import 'package:flutter/widgets.dart';
class ChatMessage extends StatelessWidget {
final List<InlineSpan> children;
const ChatMessage({Key? key, required this.children}) : super(key: key);
@override
Widget build(BuildContext context) {
return Text.rich(
TextSpan(
children: children,
),
);
}
}