Skip to content

Commit

Permalink
lightbox: added avatar image to top app bar
Browse files Browse the repository at this point in the history
  • Loading branch information
aanelson committed Jun 8, 2023
1 parent 30f7abe commit 968aca8
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions lib/widgets/lightbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,32 @@ class _LightboxPageState extends State<_LightboxPage> {
.add_Hms()
.format(DateTime.fromMillisecondsSinceEpoch(widget.message.timestamp * 1000));

final avatarUrl = widget.message.avatarUrl == null // TODO get from user data
? null // TODO handle computing gravatars
: resolveUrl(widget.message.avatarUrl!, PerAccountStoreWidget.of(context).account,
);

final avatar = avatarUrl != null
? Padding(
padding: const EdgeInsets.fromLTRB(8.0,4,0,0),
child: Container(
clipBehavior: Clip.antiAlias,
width: 35,
height: 35,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4))),
child: RealmContentNetworkImage(avatarUrl),
),
)
: const SizedBox.shrink();


appBar = AppBar(
centerTitle: false,
foregroundColor: appBarForegroundColor,
backgroundColor: appBarBackgroundColor,

// TODO(#41): Show message author's avatar
leading: avatar,
actions: const [CloseButton()],
title: RichText(
text: TextSpan(children: [
TextSpan(
Expand Down

0 comments on commit 968aca8

Please sign in to comment.