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
8ca8dbf0
Unverified
Commit
8ca8dbf0
authored
Dec 12, 2018
by
Michael Goderbauer
Committed by
GitHub
Dec 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not fade out text for pinned & floating AppBar (#25051)
parent
390ded93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
slivers_appbar_floating_pinned_test.dart
...ter/test/widgets/slivers_appbar_floating_pinned_test.dart
+36
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
8ca8dbf0
...
...
@@ -646,7 +646,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
@override
Widget
build
(
BuildContext
context
,
double
shrinkOffset
,
bool
overlapsContent
)
{
final
double
visibleMainHeight
=
maxExtent
-
shrinkOffset
-
topPadding
;
final
double
toolbarOpacity
=
pinned
&&
!
floating
?
1.0
final
double
toolbarOpacity
=
pinned
?
1.0
:
((
visibleMainHeight
-
_bottomHeight
)
/
kToolbarHeight
).
clamp
(
0.0
,
1.0
);
final
Widget
appBar
=
FlexibleSpaceBar
.
createSettings
(
minExtent:
minExtent
,
...
...
packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
View file @
8ca8dbf0
...
...
@@ -112,4 +112,40 @@ void main() {
expect
(
render
.
geometry
.
paintExtent
,
availableHeight
);
expect
(
render
.
geometry
.
layoutExtent
,
0.0
);
});
testWidgets
(
'Text does not dissapear when scrolled up'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/25000.
final
ScrollController
controller
=
ScrollController
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
CustomScrollView
(
controller:
controller
,
slivers:
<
Widget
>[
const
SliverAppBar
(
pinned:
true
,
floating:
true
,
expandedHeight:
120.0
,
title:
Text
(
'Hallo Welt!!1'
),
),
SliverList
(
delegate:
SliverChildListDelegate
(
List
<
Widget
>.
generate
(
20
,
(
int
i
)
{
return
Container
(
child:
Text
(
'Tile
$i
'
),
height:
100.0
,
);
})),
)
],
),
),
);
final
RenderParagraph
render
=
tester
.
renderObject
(
find
.
text
(
'Hallo Welt!!1'
));
expect
(
render
.
text
.
style
.
color
.
opacity
,
1.0
);
controller
.
jumpTo
(
200.0
);
await
tester
.
pumpAndSettle
();
expect
(
render
.
text
.
style
.
color
.
opacity
,
1.0
);
});
}
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