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
44ded0fe
Commit
44ded0fe
authored
7 years ago
by
Ian Hickson
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix the maths for floating pinned app bars. (#11996)" (#12071)
This reverts commit
da0602fe
.
parent
da0602fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
63 deletions
+2
-63
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-0
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+1
-1
slivers_appbar_floating_pinned_test.dart
...ter/test/widgets/slivers_appbar_floating_pinned_test.dart
+0
-62
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
44ded0fe
...
@@ -708,6 +708,7 @@ class SliverAppBar extends StatefulWidget {
...
@@ -708,6 +708,7 @@ class SliverAppBar extends StatefulWidget {
assert
(
primary
!=
null
),
assert
(
primary
!=
null
),
assert
(
floating
!=
null
),
assert
(
floating
!=
null
),
assert
(
pinned
!=
null
),
assert
(
pinned
!=
null
),
assert
(!
pinned
||
!
floating
||
bottom
!=
null
,
'A pinned and floating app bar must have a bottom widget.'
),
assert
(
snap
!=
null
),
assert
(
snap
!=
null
),
assert
(
floating
||
!
snap
,
'The "snap" argument only makes sense for floating app bars.'
),
assert
(
floating
||
!
snap
,
'The "snap" argument only makes sense for floating app bars.'
),
super
(
key:
key
);
super
(
key:
key
);
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
44ded0fe
...
@@ -512,7 +512,7 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl
...
@@ -512,7 +512,7 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl
@override
@override
double
updateGeometry
()
{
double
updateGeometry
()
{
final
double
minExtent
=
this
.
m
in
Extent
;
final
double
minExtent
=
this
.
m
ax
Extent
;
final
double
maxExtent
=
this
.
maxExtent
;
final
double
maxExtent
=
this
.
maxExtent
;
final
double
paintExtent
=
(
maxExtent
-
_effectiveScrollOffset
);
final
double
paintExtent
=
(
maxExtent
-
_effectiveScrollOffset
);
final
double
layoutExtent
=
(
maxExtent
-
constraints
.
scrollOffset
);
final
double
layoutExtent
=
(
maxExtent
-
constraints
.
scrollOffset
);
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
deleted
100644 → 0
View file @
da0602fe
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
testWidgets
(
'Sliver appbars - floating and pinned - second app bar stacks below'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
controller
=
new
ScrollController
();
await
tester
.
pumpWidget
(
new
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
new
MediaQuery
(
data:
const
MediaQueryData
(),
child:
new
CustomScrollView
(
controller:
controller
,
slivers:
<
Widget
>[
const
SliverAppBar
(
floating:
true
,
pinned:
true
,
expandedHeight:
200.0
,
title:
const
Text
(
'A'
)),
const
SliverAppBar
(
primary:
false
,
pinned:
true
,
title:
const
Text
(
'B'
)),
new
SliverList
(
delegate:
new
SliverChildListDelegate
(
<
Widget
>[
const
Text
(
'C'
),
const
Text
(
'D'
),
const
SizedBox
(
height:
500.0
),
const
Text
(
'E'
),
const
SizedBox
(
height:
500.0
),
],
),
),
],
),
),
),
);
const
Offset
textPositionInAppBar
=
const
Offset
(
16.0
,
18.0
);
expect
(
tester
.
getTopLeft
(
find
.
text
(
'A'
)),
textPositionInAppBar
);
// top app bar is 200.0 high at this point
expect
(
tester
.
getTopLeft
(
find
.
text
(
'B'
)),
const
Offset
(
0.0
,
200.0
)
+
textPositionInAppBar
);
// second app bar is 56.0 high
expect
(
tester
.
getTopLeft
(
find
.
text
(
'C'
)),
const
Offset
(
0.0
,
200.0
+
56.0
));
// height of both appbars
final
Size
cSize
=
tester
.
getSize
(
find
.
text
(
'C'
));
controller
.
jumpTo
(
200.0
-
56.0
);
await
tester
.
pump
();
expect
(
tester
.
getTopLeft
(
find
.
text
(
'A'
)),
textPositionInAppBar
);
// top app bar is now only 56.0 high, same as second
expect
(
tester
.
getTopLeft
(
find
.
text
(
'B'
)),
const
Offset
(
0.0
,
56.0
)
+
textPositionInAppBar
);
expect
(
tester
.
getTopLeft
(
find
.
text
(
'C'
)),
const
Offset
(
0.0
,
56.0
*
2.0
));
// height of both collapsed appbars
expect
(
find
.
text
(
'E'
),
findsNothing
);
controller
.
jumpTo
(
600.0
);
await
tester
.
pump
();
expect
(
tester
.
getTopLeft
(
find
.
text
(
'A'
)),
textPositionInAppBar
);
// app bar is pinned at top
expect
(
tester
.
getTopLeft
(
find
.
text
(
'B'
)),
const
Offset
(
0.0
,
56.0
)
+
textPositionInAppBar
);
// second one too
expect
(
find
.
text
(
'C'
),
findsNothing
);
// contents are scrolled off though
expect
(
find
.
text
(
'D'
),
findsNothing
);
// we have scrolled 600.0 pixels
// initial position of E was 200 + 56 + cSize.height + cSize.height + 500
// we've scrolled that up by 600.0, meaning it's at that minus 600 now:
expect
(
tester
.
getTopLeft
(
find
.
text
(
'E'
)),
new
Offset
(
0.0
,
200.0
+
56.0
+
cSize
.
height
*
2.0
+
500.0
-
600.0
));
});
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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