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);
/// * [CupertinoScrollbar], an iOS style scrollbar.
/// * [ListView], which displays a linear, scrollable list 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
/// closest Scrollable descendant of [child].
///
...
...
@@ -169,39 +169,32 @@ class Scrollbar extends StatefulWidget {
/// {@macro flutter.widgets.Scrollbar.scrollbarOrientation}
final
ScrollbarOrientation
?
scrollbarOrientation
;
@override
State
<
Scrollbar
>
createState
()
=>
_ScrollbarState
();
}
class
_ScrollbarState
extends
State
<
Scrollbar
>
{
bool
get
_useCupertinoScrollbar
=>
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
;
@override
Widget
build
(
BuildContext
context
)
{
if
(
_useCupertinoScrollbar
)
{
if
(
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
)
{
return
CupertinoScrollbar
(
isAlwaysShown:
widget
.
isAlwaysShown
??
false
,
thickness:
widget
.
thickness
??
CupertinoScrollbar
.
defaultThickness
,
thicknessWhileDragging:
widget
.
thickness
??
CupertinoScrollbar
.
defaultThicknessWhileDragging
,
radius:
widget
.
radius
??
CupertinoScrollbar
.
defaultRadius
,
radiusWhileDragging:
widget
.
radius
??
CupertinoScrollbar
.
defaultRadiusWhileDragging
,
controller:
widget
.
controller
,
notificationPredicate:
widget
.
notificationPredicate
,
scrollbarOrientation:
widget
.
scrollbarOrientation
,
child:
widget
.
child
,
isAlwaysShown:
isAlwaysShown
??
false
,
thickness:
thickness
??
CupertinoScrollbar
.
defaultThickness
,
thicknessWhileDragging:
thickness
??
CupertinoScrollbar
.
defaultThicknessWhileDragging
,
radius:
radius
??
CupertinoScrollbar
.
defaultRadius
,
radiusWhileDragging:
radius
??
CupertinoScrollbar
.
defaultRadiusWhileDragging
,
controller:
controller
,
notificationPredicate:
notificationPredicate
,
scrollbarOrientation:
scrollbarOrientation
,
child:
child
,
);
}
return
_MaterialScrollbar
(
controller:
widget
.
controller
,
isAlwaysShown:
widget
.
isAlwaysShown
,
showTrackOnHover:
widget
.
showTrackOnHover
,
hoverThickness:
widget
.
hoverThickness
,
thickness:
widget
.
thickness
,
radius:
widget
.
radius
,
notificationPredicate:
widget
.
notificationPredicate
,
interactive:
widget
.
interactive
,
scrollbarOrientation:
widget
.
scrollbarOrientation
,
child:
widget
.
child
,
controller:
controller
,
isAlwaysShown:
isAlwaysShown
,
showTrackOnHover:
showTrackOnHover
,
hoverThickness:
hoverThickness
,
thickness:
thickness
,
radius:
radius
,
notificationPredicate:
notificationPredicate
,
interactive:
interactive
,
scrollbarOrientation:
scrollbarOrientation
,
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