Skip to content

Commit

Permalink
TW-977: fix quote indicator expand
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE committed Nov 21, 2023
1 parent 39a3517 commit 04426ba
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 37 deletions.
87 changes: 50 additions & 37 deletions lib/pages/chat/events/reply_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,44 +68,57 @@ class ReplyContent extends StatelessWidget {
padding: ReplyContentStyle.replyParentContainerPadding,
decoration:
ReplyContentStyle.replyParentContainerDecoration(context, ownMessage),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: ReplyContentStyle.prefixBarWidth,
height: ReplyContentStyle.fontSizeDisplayContent * 2,
decoration: ReplyContentStyle.prefixBarDecoration(context),
),
const SizedBox(width: ReplyContentStyle.prefixAndDisplayNameSpacing),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
if (user != null)
Text(
user.calcDisplayname(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ReplyContentStyle.displayNameTextStyle(context),
),
if (displayEvent.getUser() == null)
FutureBuilder<User?>(
future: displayEvent.fetchSenderUser(),
builder: (context, snapshot) {
return Text(
'${snapshot.data?.calcDisplayname() ?? displayEvent.senderFromMemoryOrFallback.calcDisplayname()}:',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ReplyContentStyle.displayNameTextStyle(context),
);
},
),
replyBody,
],
child: IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
vertical: ReplyContentStyle.prefixBarVerticalPadding,
),
child: Container(
constraints: const BoxConstraints(
minHeight: ReplyContentStyle.fontSizeDisplayContent * 2,
),
width: ReplyContentStyle.prefixBarWidth,
decoration: ReplyContentStyle.prefixBarDecoration(context),
),
),
),
],
const SizedBox(
width: ReplyContentStyle.prefixAndDisplayNameSpacing,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
if (user != null)
Text(
user.calcDisplayname(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ReplyContentStyle.displayNameTextStyle(context),
),
if (displayEvent.getUser() == null)
FutureBuilder<User?>(
future: displayEvent.fetchSenderUser(),
builder: (context, snapshot) {
return Text(
'${snapshot.data?.calcDisplayname() ?? displayEvent.senderFromMemoryOrFallback.calcDisplayname()}:',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style:
ReplyContentStyle.displayNameTextStyle(context),
);
},
),
replyBody,
],
),
),
],
),
),
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/pages/chat/events/reply_content_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ReplyContentStyle {
}

static const double prefixBarWidth = 3.0;
static const double prefixBarVerticalPadding = 4.0;
static BoxDecoration prefixBarDecoration(BuildContext context) {
return BoxDecoration(
borderRadius: BorderRadius.circular(2),
Expand Down

0 comments on commit 04426ba

Please sign in to comment.