Skip to content

Commit d3edfb5

Browse files
committed
Sync lightbox AppBar and BottomAppBar animation
1 parent 79b6647 commit d3edfb5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/widgets/lightbox.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter/scheduler.dart';
23
import 'package:flutter/services.dart';
34
import 'package:intl/intl.dart';
45

@@ -132,6 +133,8 @@ class _LightboxPageState extends State<LightboxPage> {
132133
final appBarBackgroundColor = Colors.grey.shade900.withOpacity(0.87);
133134
const appBarForegroundColor = Colors.white;
134135

136+
timeDilation = 20;
137+
135138
// TODO(#45): Format with e.g. "Yesterday at 4:47 PM"
136139
final timestampText = DateFormat
137140
.yMMMd(/* TODO(i18n): Pass selected language here, I think? */)
@@ -143,14 +146,15 @@ class _LightboxPageState extends State<LightboxPage> {
143146
child: AnimatedContainer(
144147
duration: const Duration(milliseconds: 100),
145148
curve: Curves.easeIn,
146-
height: _headerFooterVisible ? AppBar.preferredHeightFor(context,
147-
MediaQuery.of(context).size)
149+
height: _headerFooterVisible ? AppBar.preferredHeightFor(
150+
context,
151+
Size(0, MediaQuery.of(context).padding.top + kToolbarHeight)
152+
)
148153
: 0,
149154
child: AppBar(
150155
centerTitle: false,
151156
foregroundColor: appBarForegroundColor,
152157
backgroundColor: appBarBackgroundColor,
153-
154158
// TODO(#41): Show message author's avatar
155159
title: RichText(
156160
text: TextSpan(children: [

0 commit comments

Comments
 (0)