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
dc691304
Unverified
Commit
dc691304
authored
Aug 04, 2021
by
Viren Khatri
Committed by
GitHub
Aug 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed Scrollbar to StatelessWidget (#87647)
parent
0f4e1db7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
28 deletions
+21
-28
scrollbar.dart
packages/flutter/lib/src/material/scrollbar.dart
+21
-28
No files found.
packages/flutter/lib/src/material/scrollbar.dart
View file @
dc691304
...
@@ -91,7 +91,7 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600);
...
@@ -91,7 +91,7 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600);
/// * [CupertinoScrollbar], an iOS style scrollbar.
/// * [CupertinoScrollbar], an iOS style scrollbar.
/// * [ListView], which displays a linear, scrollable list of children.
/// * [ListView], which displays a linear, scrollable list of children.
/// * [GridView], which displays a 2 dimensional, scrollable array of children.
/// * [GridView], which displays a 2 dimensional, scrollable array of children.
class
Scrollbar
extends
State
ful
Widget
{
class
Scrollbar
extends
State
less
Widget
{
/// Creates a material design scrollbar that by default will connect to the
/// Creates a material design scrollbar that by default will connect to the
/// closest Scrollable descendant of [child].
/// closest Scrollable descendant of [child].
///
///
...
@@ -169,39 +169,32 @@ class Scrollbar extends StatefulWidget {
...
@@ -169,39 +169,32 @@ class Scrollbar extends StatefulWidget {
/// {@macro flutter.widgets.Scrollbar.scrollbarOrientation}
/// {@macro flutter.widgets.Scrollbar.scrollbarOrientation}
final
ScrollbarOrientation
?
scrollbarOrientation
;
final
ScrollbarOrientation
?
scrollbarOrientation
;
@override
State
<
Scrollbar
>
createState
()
=>
_ScrollbarState
();
}
class
_ScrollbarState
extends
State
<
Scrollbar
>
{
bool
get
_useCupertinoScrollbar
=>
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
if
(
_useCupertinoScrollbar
)
{
if
(
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
)
{
return
CupertinoScrollbar
(
return
CupertinoScrollbar
(
isAlwaysShown:
widget
.
isAlwaysShown
??
false
,
isAlwaysShown:
isAlwaysShown
??
false
,
thickness:
widget
.
thickness
??
CupertinoScrollbar
.
defaultThickness
,
thickness:
thickness
??
CupertinoScrollbar
.
defaultThickness
,
thicknessWhileDragging:
widget
.
thickness
??
CupertinoScrollbar
.
defaultThicknessWhileDragging
,
thicknessWhileDragging:
thickness
??
CupertinoScrollbar
.
defaultThicknessWhileDragging
,
radius:
widget
.
radius
??
CupertinoScrollbar
.
defaultRadius
,
radius:
radius
??
CupertinoScrollbar
.
defaultRadius
,
radiusWhileDragging:
widget
.
radius
??
CupertinoScrollbar
.
defaultRadiusWhileDragging
,
radiusWhileDragging:
radius
??
CupertinoScrollbar
.
defaultRadiusWhileDragging
,
controller:
widget
.
controller
,
controller:
controller
,
notificationPredicate:
widget
.
notificationPredicate
,
notificationPredicate:
notificationPredicate
,
scrollbarOrientation:
widget
.
scrollbarOrientation
,
scrollbarOrientation:
scrollbarOrientation
,
child:
widget
.
child
,
child:
child
,
);
);
}
}
return
_MaterialScrollbar
(
return
_MaterialScrollbar
(
controller:
widget
.
controller
,
controller:
controller
,
isAlwaysShown:
widget
.
isAlwaysShown
,
isAlwaysShown:
isAlwaysShown
,
showTrackOnHover:
widget
.
showTrackOnHover
,
showTrackOnHover:
showTrackOnHover
,
hoverThickness:
widget
.
hoverThickness
,
hoverThickness:
hoverThickness
,
thickness:
widget
.
thickness
,
thickness:
thickness
,
radius:
widget
.
radius
,
radius:
radius
,
notificationPredicate:
widget
.
notificationPredicate
,
notificationPredicate:
notificationPredicate
,
interactive:
widget
.
interactive
,
interactive:
interactive
,
scrollbarOrientation:
widget
.
scrollbarOrientation
,
scrollbarOrientation:
scrollbarOrientation
,
child:
widget
.
child
,
child:
child
,
);
);
}
}
}
}
...
...
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