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
a82a3997
Unverified
Commit
a82a3997
authored
Dec 17, 2019
by
LongCatIsLooong
Committed by
GitHub
Dec 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove mediaQuery bottom padding when the tab scaffold has an opaque navbar (#46106)
parent
0a2d8e0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
tab_scaffold.dart
packages/flutter/lib/src/cupertino/tab_scaffold.dart
+1
-0
tab_scaffold_test.dart
packages/flutter/test/cupertino/tab_scaffold_test.dart
+31
-0
No files found.
packages/flutter/lib/src/cupertino/tab_scaffold.dart
View file @
a82a3997
...
...
@@ -380,6 +380,7 @@ class _CupertinoTabScaffoldState extends State<CupertinoTabScaffold> {
// obstructed area.
if
(
widget
.
tabBar
.
opaque
(
context
))
{
contentPadding
=
EdgeInsets
.
only
(
bottom:
bottomPadding
);
newMediaQuery
=
newMediaQuery
.
removePadding
(
removeBottom:
true
);
}
else
{
newMediaQuery
=
newMediaQuery
.
copyWith
(
padding:
newMediaQuery
.
padding
.
copyWith
(
...
...
packages/flutter/test/cupertino/tab_scaffold_test.dart
View file @
a82a3997
...
...
@@ -476,6 +476,37 @@ void main() {
expect
(
initialPoint
,
finalPoint
);
});
testWidgets
(
'Opaque tab bar consumes bottom padding while non opaque tab bar does not'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/43581.
Future
<
EdgeInsets
>
getContentPaddingWithTabBarColor
(
Color
color
)
async
{
EdgeInsets
contentPadding
;
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
MediaQuery
(
data:
const
MediaQueryData
(
padding:
EdgeInsets
.
only
(
bottom:
50
)),
child:
CupertinoTabScaffold
(
tabBar:
CupertinoTabBar
(
backgroundColor:
color
,
items:
List
<
BottomNavigationBarItem
>.
generate
(
2
,
tabGenerator
),
),
tabBuilder:
(
BuildContext
context
,
int
index
)
{
contentPadding
=
MediaQuery
.
of
(
context
).
padding
;
return
const
Placeholder
();
}
),
),
),
);
return
contentPadding
;
}
expect
(
await
getContentPaddingWithTabBarColor
(
const
Color
(
0xAAFFFFFF
)),
isNot
(
EdgeInsets
.
zero
));
expect
(
await
getContentPaddingWithTabBarColor
(
const
Color
(
0xFFFFFFFF
)),
EdgeInsets
.
zero
);
});
testWidgets
(
'Tab and page scaffolds do not double stack view insets'
,
(
WidgetTester
tester
)
async
{
BuildContext
innerContext
;
...
...
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