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
53322958
Unverified
Commit
53322958
authored
Sep 19, 2022
by
Kate Lovett
Committed by
GitHub
Sep 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated ScrollBehavior.buildViewportChrome (#111715)
parent
9e87a5b0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
50 deletions
+96
-50
fix_data.yaml
packages/flutter/lib/fix_data.yaml
+33
-0
app.dart
packages/flutter/lib/src/cupertino/app.dart
+2
-0
app.dart
packages/flutter/lib/src/material/app.dart
+2
-2
scroll_configuration.dart
packages/flutter/lib/src/widgets/scroll_configuration.dart
+26
-47
cupertino.dart
packages/flutter/test_fixes/cupertino.dart
+6
-0
cupertino.dart.expect
packages/flutter/test_fixes/cupertino.dart.expect
+6
-0
material.dart
packages/flutter/test_fixes/material.dart
+6
-0
material.dart.expect
packages/flutter/test_fixes/material.dart.expect
+7
-1
widgets.dart
packages/flutter/test_fixes/widgets.dart
+4
-0
widgets.dart.expect
packages/flutter/test_fixes/widgets.dart.expect
+4
-0
No files found.
packages/flutter/lib/fix_data.yaml
View file @
53322958
...
...
@@ -17,6 +17,39 @@
version
:
1
transforms
:
# Changes made in https://github.com/flutter/flutter/pull/78588
-
title
:
"
Migrate
to
'buildOverscrollIndicator'"
date
:
2021-03-18
element
:
uris
:
[
'
widgets.dart'
,
'
material.dart'
,
'
cupertino.dart'
]
method
:
'
buildViewportChrome'
inClass
:
'
ScrollBehavior'
changes
:
-
kind
:
'
rename'
newName
:
'
buildOverscrollIndicator'
# Changes made in https://github.com/flutter/flutter/pull/78588
-
title
:
"
Migrate
to
'buildOverscrollIndicator'"
date
:
2021-03-18
element
:
uris
:
[
'
material.dart'
]
method
:
'
buildViewportChrome'
inClass
:
'
MaterialScrollBehavior'
changes
:
-
kind
:
'
rename'
newName
:
'
buildOverscrollIndicator'
# Changes made in https://github.com/flutter/flutter/pull/78588
-
title
:
"
Migrate
to
'buildOverscrollIndicator'"
date
:
2021-03-18
element
:
uris
:
[
'
cupertino.dart'
]
method
:
'
buildViewportChrome'
inClass
:
'
CupertinoScrollBehavior'
changes
:
-
kind
:
'
rename'
newName
:
'
buildOverscrollIndicator'
# Changes made in https://github.com/flutter/flutter/pull/111706
-
title
:
"
Migrate
to
'trackVisibility'"
date
:
2022-09-15
...
...
packages/flutter/lib/src/cupertino/app.dart
View file @
53322958
...
...
@@ -480,6 +480,8 @@ class CupertinoScrollBehavior extends ScrollBehavior {
@override
ScrollPhysics
getScrollPhysics
(
BuildContext
context
)
{
// When modifying this function, consider modifying the implementation in
// the base class ScrollBehavior as well.
if
(
getPlatform
(
context
)
==
TargetPlatform
.
macOS
)
{
return
const
BouncingScrollPhysics
(
decelerationRate:
ScrollDecelerationRate
.
fast
);
}
...
...
packages/flutter/lib/src/material/app.dart
View file @
53322958
...
...
@@ -817,7 +817,7 @@ class MaterialScrollBehavior extends ScrollBehavior {
@override
Widget
buildScrollbar
(
BuildContext
context
,
Widget
child
,
ScrollableDetails
details
)
{
// When modifying this function, consider modifying the implementation in
// the base class as well.
// the base class
ScrollBehavior
as well.
switch
(
axisDirectionToAxis
(
details
.
direction
))
{
case
Axis
.
horizontal
:
return
child
;
...
...
@@ -841,7 +841,7 @@ class MaterialScrollBehavior extends ScrollBehavior {
@override
Widget
buildOverscrollIndicator
(
BuildContext
context
,
Widget
child
,
ScrollableDetails
details
)
{
// When modifying this function, consider modifying the implementation in
// the base class as well.
// the base class
ScrollBehavior
as well.
late
final
AndroidOverscrollIndicator
indicator
;
if
(
Theme
.
of
(
context
).
useMaterial3
)
{
indicator
=
AndroidOverscrollIndicator
.
stretch
;
...
...
packages/flutter/lib/src/widgets/scroll_configuration.dart
View file @
53322958
...
...
@@ -132,45 +132,6 @@ class ScrollBehavior {
/// impossible to select text in scrollable containers and is not recommended.
Set
<
PointerDeviceKind
>
get
dragDevices
=>
_kTouchLikeDeviceTypes
;
/// Wraps the given widget, which scrolls in the given [AxisDirection].
///
/// For example, on Android, this method wraps the given widget with a
/// [GlowingOverscrollIndicator] to provide visual feedback when the user
/// overscrolls.
///
/// This method is deprecated. Use [ScrollBehavior.buildOverscrollIndicator]
/// instead.
@Deprecated
(
'Migrate to buildOverscrollIndicator. '
'This feature was deprecated after v2.1.0-11.0.pre.'
,
)
Widget
buildViewportChrome
(
BuildContext
context
,
Widget
child
,
AxisDirection
axisDirection
)
{
switch
(
getPlatform
(
context
))
{
case
TargetPlatform
.
iOS
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
macOS
:
case
TargetPlatform
.
windows
:
return
child
;
case
TargetPlatform
.
android
:
switch
(
androidOverscrollIndicator
)
{
case
AndroidOverscrollIndicator
.
stretch
:
return
StretchingOverscrollIndicator
(
axisDirection:
axisDirection
,
child:
child
,
);
case
AndroidOverscrollIndicator
.
glow
:
continue
glow
;
}
glow:
case
TargetPlatform
.
fuchsia
:
return
GlowingOverscrollIndicator
(
axisDirection:
axisDirection
,
color:
_kDefaultGlowColor
,
child:
child
,
);
}
}
/// Applies a [RawScrollbar] to the child widget on desktop platforms.
Widget
buildScrollbar
(
BuildContext
context
,
Widget
child
,
ScrollableDetails
details
)
{
// When modifying this function, consider modifying the implementation in
...
...
@@ -193,11 +154,32 @@ class ScrollBehavior {
/// Applies a [GlowingOverscrollIndicator] to the child widget on
/// [TargetPlatform.android] and [TargetPlatform.fuchsia].
Widget
buildOverscrollIndicator
(
BuildContext
context
,
Widget
child
,
ScrollableDetails
details
)
{
// TODO(Piinks): Move implementation from buildViewportChrome here after
// deprecation period
// When modifying this function, consider modifying the implementation in
// the Material and Cupertino subclasses as well.
return
buildViewportChrome
(
context
,
child
,
details
.
direction
);
switch
(
getPlatform
(
context
))
{
case
TargetPlatform
.
iOS
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
macOS
:
case
TargetPlatform
.
windows
:
return
child
;
case
TargetPlatform
.
android
:
switch
(
androidOverscrollIndicator
)
{
case
AndroidOverscrollIndicator
.
stretch
:
return
StretchingOverscrollIndicator
(
axisDirection:
details
.
direction
,
child:
child
,
);
case
AndroidOverscrollIndicator
.
glow
:
continue
glow
;
}
glow:
case
TargetPlatform
.
fuchsia
:
return
GlowingOverscrollIndicator
(
axisDirection:
details
.
direction
,
color:
_kDefaultGlowColor
,
child:
child
,
);
}
}
/// Specifies the type of velocity tracker to use in the descendant
...
...
@@ -243,6 +225,8 @@ class ScrollBehavior {
/// [BouncingScrollPhysics] on iOS and [ClampingScrollPhysics] on
/// Android.
ScrollPhysics
getScrollPhysics
(
BuildContext
context
)
{
// When modifying this function, consider modifying the implementation in
// the Material and Cupertino subclasses as well.
switch
(
getPlatform
(
context
))
{
case
TargetPlatform
.
iOS
:
return
_bouncingPhysics
;
...
...
@@ -315,11 +299,6 @@ class _WrappedScrollBehavior implements ScrollBehavior {
return
child
;
}
@override
Widget
buildViewportChrome
(
BuildContext
context
,
Widget
child
,
AxisDirection
axisDirection
)
{
return
delegate
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
}
@override
ScrollBehavior
copyWith
({
bool
?
scrollbars
,
...
...
packages/flutter/test_fixes/cupertino.dart
View file @
53322958
...
...
@@ -229,4 +229,10 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/100381
TextSelectionOverlay
.
fadeDuration
;
// Changes made in https://github.com/flutter/flutter/pull/78588
final
ScrollBehavior
scrollBehavior
=
ScrollBehavior
();
scrollBehavior
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
final
CupertinoScrollBehavior
cupertinoScrollBehavior
=
CupertinoScrollBehavior
();
cupertinoScrollBehavior
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
}
packages/flutter/test_fixes/cupertino.dart.expect
View file @
53322958
...
...
@@ -229,4 +229,10 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/100381
SelectionOverlay.fadeDuration;
// Changes made in https://github.com/flutter/flutter/pull/78588
final ScrollBehavior scrollBehavior = ScrollBehavior();
scrollBehavior.buildOverscrollIndicator(context, child, axisDirection);
final CupertinoScrollBehavior cupertinoScrollBehavior = CupertinoScrollBehavior();
cupertinoScrollBehavior.buildOverscrollIndicator(context, child, axisDirection);
}
packages/flutter/test_fixes/material.dart
View file @
53322958
...
...
@@ -695,6 +695,12 @@ void main() {
themeData
=
ThemeData
.
raw
(
bottomAppBarColor:
Colors
.
green
);
themeData
=
ThemeData
.
copyWith
(
bottomAppBarColor:
Colors
.
green
);
// Changes made in https://github.com/flutter/flutter/pull/78588
final
ScrollBehavior
scrollBehavior
=
ScrollBehavior
();
scrollBehavior
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
final
MaterialScrollBehavior
materialScrollBehavior
=
MaterialScrollBehavior
();
materialScrollBehavior
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
// Changes made in https://github.com/flutter/flutter/pull/111706
Scrollbar
scrollbar
=
Scrollbar
(
showTrackOnHover:
true
);
bool
nowShowing
=
scrollbar
.
showTrackOnHover
;
...
...
packages/flutter/test_fixes/material.dart.expect
View file @
53322958
...
...
@@ -889,7 +889,7 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(colorScheme: ColorScheme(
error: Colors.red).copyWith(background: Colors.grey
));
themeData = ThemeData(colorScheme: ColorScheme(
background: Colors.grey).copyWith(error: Colors.red
));
themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
...
...
@@ -899,6 +899,12 @@ void main() {
themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
// Changes made in https://github.com/flutter/flutter/pull/78588
final ScrollBehavior scrollBehavior = ScrollBehavior();
scrollBehavior.buildOverscrollIndicator(context, child, axisDirection);
final MaterialScrollBehavior materialScrollBehavior = MaterialScrollBehavior();
materialScrollBehavior.buildOverscrollIndicator(context, child, axisDirection);
// Changes made in https://github.com/flutter/flutter/pull/111706
Scrollbar scrollbar = Scrollbar(trackVisibility: true);
bool nowShowing = scrollbar.trackVisibility;
...
...
packages/flutter/test_fixes/widgets.dart
View file @
53322958
...
...
@@ -184,4 +184,8 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/100381
TextSelectionOverlay
.
fadeDuration
;
// Changes made in https://github.com/flutter/flutter/pull/78588
final
ScrollBehavior
scrollBehavior
=
ScrollBehavior
();
scrollBehavior
.
buildViewportChrome
(
context
,
child
,
axisDirection
);
}
packages/flutter/test_fixes/widgets.dart.expect
View file @
53322958
...
...
@@ -184,4 +184,8 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/100381
SelectionOverlay.fadeDuration;
// Changes made in https://github.com/flutter/flutter/pull/78588
final ScrollBehavior scrollBehavior = ScrollBehavior();
scrollBehavior.buildOverscrollIndicator(context, child, axisDirection);
}
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