Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7b2f6604
Commit
7b2f6604
authored
Aug 18, 2016
by
Hans Muller
Committed by
GitHub
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stablize gallery status bar height computation (#5485)
parent
6e9bbca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+5
-6
No files found.
examples/flutter_gallery/lib/gallery/home.dart
View file @
7b2f6604
...
...
@@ -105,12 +105,6 @@ class GalleryHomeState extends State<GalleryHome> {
void
initState
()
{
super
.
initState
();
// The first item in the list just exists to occupy the space behind
// the flexible app bar. As it's scrolled out of the way, the app bar's
// height will shrink.
final
double
statusBarHeight
=
(
MediaQuery
.
of
(
context
)?.
padding
??
EdgeInsets
.
zero
).
top
;
_listItems
.
add
(
new
SizedBox
(
height:
_kFlexibleSpaceMaxHeight
+
statusBarHeight
));
final
ThemeData
themeData
=
Theme
.
of
(
context
);
final
TextStyle
headerStyle
=
themeData
.
textTheme
.
body2
.
copyWith
(
color:
themeData
.
accentColor
);
String
category
;
...
...
@@ -134,6 +128,7 @@ class GalleryHomeState extends State<GalleryHome> {
@override
Widget
build
(
BuildContext
context
)
{
final
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
return
new
Scaffold
(
key:
_homeKey
,
scrollableKey:
_scrollableKey
,
...
...
@@ -159,8 +154,12 @@ class GalleryHomeState extends State<GalleryHome> {
)
),
appBarBehavior:
AppBarBehavior
.
under
,
// The block's padding just exists to occupy the space behind the flexible app bar.
// As the block's padded region is scrolled upwards, the app bar's height will
// shrink keep it above the block content's and over the padded region.
body:
new
Block
(
scrollableKey:
_scrollableKey
,
padding:
new
EdgeInsets
.
only
(
top:
_kFlexibleSpaceMaxHeight
+
statusBarHeight
),
children:
_listItems
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment