2020-02-11 11:49:39 +00:00
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
2020-05-05 12:55:19 +00:00
|
|
|
import 'package:fluffychat/i18n/i18n.dart';
|
2020-02-11 11:49:39 +00:00
|
|
|
import 'package:fluffychat/utils/event_extension.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class ReplyContent extends StatelessWidget {
|
|
|
|
final Event replyEvent;
|
|
|
|
final bool lightText;
|
|
|
|
|
|
|
|
const ReplyContent(this.replyEvent, {this.lightText = false, Key key})
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Row(
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
width: 3,
|
|
|
|
height: 36,
|
|
|
|
color: lightText ? Colors.white : Theme.of(context).primaryColor,
|
|
|
|
),
|
|
|
|
SizedBox(width: 6),
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
|
|
|
(replyEvent?.sender?.calcDisplayname() ?? "") + ":",
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color:
|
|
|
|
lightText ? Colors.white : Theme.of(context).primaryColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
2020-05-05 12:55:19 +00:00
|
|
|
replyEvent?.getLocalizedBody(
|
|
|
|
I18n.of(context),
|
|
|
|
withSenderNamePrefix: false,
|
|
|
|
hideReply: true,
|
|
|
|
) ??
|
2020-02-11 11:49:39 +00:00
|
|
|
"",
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 1,
|
2020-02-16 19:32:29 +00:00
|
|
|
style: TextStyle(
|
|
|
|
color: lightText
|
|
|
|
? Colors.white
|
2020-02-16 19:35:08 +00:00
|
|
|
: Theme.of(context).textTheme.body1.color),
|
2020-02-11 11:49:39 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|