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
00143388
Unverified
Commit
00143388
authored
Jan 26, 2021
by
xster
Committed by
GitHub
Jan 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default CupertinoSliverNavigationBar's stretch to false (#74669)
parent
d1538320
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
nav_bar.dart
packages/flutter/lib/src/cupertino/nav_bar.dart
+8
-3
nav_bar_test.dart
packages/flutter/test/cupertino/nav_bar_test.dart
+1
-0
refresh_test.dart
packages/flutter/test/cupertino/refresh_test.dart
+41
-0
No files found.
packages/flutter/lib/src/cupertino/nav_bar.dart
View file @
00143388
...
...
@@ -541,7 +541,7 @@ class _CupertinoNavigationBarState extends State<CupertinoNavigationBar> {
/// The [stretch] parameter determines whether the nav bar should stretch to
/// fill the over-scroll area. The nav bar can still expand and contract as the
/// user scrolls, but it will also stretch when the user over-scrolls if the
/// [stretch] value is `true`. Defaults to `
tru
e`.
/// [stretch] value is `true`. Defaults to `
fals
e`.
///
/// See also:
///
...
...
@@ -566,7 +566,7 @@ class CupertinoSliverNavigationBar extends StatefulWidget {
this
.
padding
,
this
.
transitionBetweenRoutes
=
true
,
this
.
heroTag
=
_defaultHeroTag
,
this
.
stretch
=
tru
e
,
this
.
stretch
=
fals
e
,
})
:
assert
(
automaticallyImplyLeading
!=
null
),
assert
(
automaticallyImplyTitle
!=
null
),
assert
(
...
...
@@ -658,7 +658,12 @@ class CupertinoSliverNavigationBar extends StatefulWidget {
///
/// The nav bar can still expand and contract as the user scrolls, but it will
/// also stretch when the user over-scrolls if the [stretch] value is `true`.
/// Defaults to `true`.
///
/// When set to `true`, the nav bar will prevent subsequent slivers from
/// accessing overscrolls. This may be undesirable for using overscroll-based
/// widgets like the [CupertinoSliverRefreshControl].
///
/// Defaults to `false`.
final
bool
stretch
;
@override
...
...
packages/flutter/test/cupertino/nav_bar_test.dart
View file @
00143388
...
...
@@ -1230,6 +1230,7 @@ void main() {
const
CupertinoSliverNavigationBar
(
trailing:
trailingText
,
largeTitle:
titleText
,
stretch:
true
,
),
SliverToBoxAdapter
(
child:
Container
(
...
...
packages/flutter/test/cupertino/refresh_test.dart
View file @
00143388
...
...
@@ -918,6 +918,47 @@ void main() {
expect
(
tester
.
takeException
(),
isNull
);
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
// Test to make sure the refresh sliver's overscroll isn't eaten by the
// nav bar sliver https://github.com/flutter/flutter/issues/74516.
testWidgets
(
'properly displays when the refresh sliver is behind the large title nav bar sliver'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
CustomScrollView
(
slivers:
<
Widget
>[
const
CupertinoSliverNavigationBar
(
largeTitle:
Text
(
'Title'
),
),
CupertinoSliverRefreshControl
(
builder:
mockHelper
.
builder
,
),
buildAListOfStuff
(),
],
),
),
);
final
double
initialFirstCellY
=
tester
.
getTopLeft
(
find
.
widgetWithText
(
Container
,
'0'
)).
dy
;
// Drag down but not enough to trigger the refresh.
await
tester
.
drag
(
find
.
text
(
'0'
),
const
Offset
(
0.0
,
50.0
),
touchSlopY:
0
);
await
tester
.
pump
();
expect
(
mockHelper
.
invocations
.
first
,
matchesBuilder
(
refreshState:
RefreshIndicatorMode
.
drag
,
pulledExtent:
50
,
refreshTriggerPullDistance:
100
,
// default value.
refreshIndicatorExtent:
60
,
// default value.
));
expect
(
mockHelper
.
invocations
,
hasLength
(
1
));
expect
(
tester
.
getTopLeft
(
find
.
widgetWithText
(
Container
,
'0'
)).
dy
,
initialFirstCellY
+
50
);
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
};
final
VoidCallback
stateMachineTestGroup
=
()
{
...
...
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