Skip to content

Commit 79b6647

Browse files
committed
minor: formatting
1 parent 853a69b commit 79b6647

File tree

1 file changed

+44
-48
lines changed

1 file changed

+44
-48
lines changed

lib/widgets/lightbox.dart

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -133,58 +133,54 @@ class _LightboxPageState extends State<LightboxPage> {
133133
const appBarForegroundColor = Colors.white;
134134

135135
// TODO(#45): Format with e.g. "Yesterday at 4:47 PM"
136-
final timestampText = DateFormat.yMMMd(
137-
/* TODO(i18n): Pass selected language here, I think? */)
138-
.add_Hms()
139-
.format(DateTime.fromMillisecondsSinceEpoch(
140-
widget.message.timestamp * 1000));
136+
final timestampText = DateFormat
137+
.yMMMd(/* TODO(i18n): Pass selected language here, I think? */)
138+
.add_Hms()
139+
.format(DateTime.fromMillisecondsSinceEpoch(widget.message.timestamp * 1000));
141140

142141
final appBar = PreferredSize(
143-
preferredSize: Size(MediaQuery.of(context).size.width, kToolbarHeight),
144-
child: AnimatedContainer(
145-
duration: const Duration(milliseconds: 100),
146-
curve: Curves.easeIn,
147-
height: _headerFooterVisible ? AppBar.preferredHeightFor(context,
148-
MediaQuery.of(context).size)
149-
: 0,
150-
child: AppBar(
151-
centerTitle: false,
152-
foregroundColor: appBarForegroundColor,
153-
backgroundColor: appBarBackgroundColor,
154-
155-
// TODO(#41): Show message author's avatar
156-
title: RichText(
157-
text: TextSpan(children: [
158-
TextSpan(
159-
text: '${widget.message.senderFullName}\n',
160-
161-
// Restate default
162-
style: themeData.textTheme.titleLarge!
163-
.copyWith(color: appBarForegroundColor)),
164-
TextSpan(
165-
text: timestampText,
166-
167-
// Make smaller, like a subtitle
168-
style: themeData.textTheme.titleSmall!
169-
.copyWith(color: appBarForegroundColor)),
170-
])))));
171-
172-
173-
final bottomAppBar = AnimatedContainer(
142+
preferredSize: Size(MediaQuery.of(context).size.width, kToolbarHeight),
143+
child: AnimatedContainer(
174144
duration: const Duration(milliseconds: 100),
175145
curve: Curves.easeIn,
176-
// 80 is the default in M3, we need to set a value for the animation
177-
// to work
178-
height: _headerFooterVisible
179-
? BottomAppBarTheme.of(context).height ?? 80
180-
: 0,
181-
child: BottomAppBar(
182-
color: appBarBackgroundColor,
183-
child: Row(children: [
184-
_CopyLinkButton(url: widget.src),
185-
// TODO(#43): Share image
186-
// TODO(#42): Download image
187-
])));
146+
height: _headerFooterVisible ? AppBar.preferredHeightFor(context,
147+
MediaQuery.of(context).size)
148+
: 0,
149+
child: AppBar(
150+
centerTitle: false,
151+
foregroundColor: appBarForegroundColor,
152+
backgroundColor: appBarBackgroundColor,
153+
154+
// TODO(#41): Show message author's avatar
155+
title: RichText(
156+
text: TextSpan(children: [
157+
TextSpan(
158+
text: '${widget.message.senderFullName}\n',
159+
160+
// Restate default
161+
style: themeData.textTheme.titleLarge!.copyWith(color: appBarForegroundColor)),
162+
TextSpan(
163+
text: timestampText,
164+
165+
// Make smaller, like a subtitle
166+
style: themeData.textTheme.titleSmall!.copyWith(color: appBarForegroundColor)),
167+
])))));
168+
169+
final bottomAppBar = AnimatedContainer(
170+
duration: const Duration(milliseconds: 100),
171+
curve: Curves.easeIn,
172+
// 80 is the default in M3, we need to set a value for the animation
173+
// to work
174+
height: _headerFooterVisible
175+
? BottomAppBarTheme.of(context).height ?? 80
176+
: 0,
177+
child: BottomAppBar(
178+
color: appBarBackgroundColor,
179+
child: Row(children: [
180+
_CopyLinkButton(url: widget.src),
181+
// TODO(#43): Share image
182+
// TODO(#42): Download image
183+
])));
188184

189185
return Theme(
190186
data: themeData.copyWith(

0 commit comments

Comments
 (0)