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
7011d308
Unverified
Commit
7011d308
authored
Feb 28, 2020
by
Justin McCandless
Committed by
GitHub
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AppBar Height Fix (#48761)
parent
ae027c19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-0
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+30
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
7011d308
...
...
@@ -603,6 +603,7 @@ class _AppBarState extends State<AppBar> {
// The padding applies to the toolbar and tabbar, not the flexible space.
if
(
widget
.
primary
)
{
appBar
=
SafeArea
(
bottom:
false
,
top:
true
,
child:
appBar
,
);
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
7011d308
...
...
@@ -965,6 +965,36 @@ void main() {
expect
(
tester
.
getTopLeft
(
find
.
text
(
'title'
)).
dy
,
lessThan
(
100.0
));
});
testWidgets
(
'AppBar in body excludes bottom SafeArea padding'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/26163
await
tester
.
pumpWidget
(
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
DefaultMaterialLocalizations
.
delegate
,
DefaultWidgetsLocalizations
.
delegate
,
],
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
data:
const
MediaQueryData
(
padding:
EdgeInsets
.
symmetric
(
vertical:
100.0
)),
child:
Scaffold
(
primary:
true
,
body:
Column
(
children:
<
Widget
>[
AppBar
(
title:
const
Text
(
'title'
),
),
],
),
),
),
),
));
expect
(
appBarTop
(
tester
),
0.0
);
expect
(
appBarHeight
(
tester
),
kToolbarHeight
+
100.0
);
});
testWidgets
(
'AppBar updates when you add a drawer'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
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