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
017fc6c9
Unverified
Commit
017fc6c9
authored
Jul 07, 2022
by
Kate Lovett
Committed by
GitHub
Jul 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RawScrollbar colors (#107177)
parent
8d41c646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
scrollbar.dart
packages/flutter/lib/src/widgets/scrollbar.dart
+6
-2
scrollbar_test.dart
packages/flutter/test/widgets/scrollbar_test.dart
+46
-0
No files found.
packages/flutter/lib/src/widgets/scrollbar.dart
View file @
017fc6c9
...
@@ -1572,8 +1572,12 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
...
@@ -1572,8 +1572,12 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
scrollbarPainter
scrollbarPainter
..
color
=
widget
.
thumbColor
??
const
Color
(
0x66BCBCBC
)
..
color
=
widget
.
thumbColor
??
const
Color
(
0x66BCBCBC
)
..
trackRadius
=
widget
.
trackRadius
..
trackRadius
=
widget
.
trackRadius
..
trackColor
=
_showTrack
?
const
Color
(
0x08000000
)
:
const
Color
(
0x00000000
)
..
trackColor
=
_showTrack
..
trackBorderColor
=
_showTrack
?
const
Color
(
0x1a000000
)
:
const
Color
(
0x00000000
)
?
widget
.
trackColor
??
const
Color
(
0x08000000
)
:
const
Color
(
0x00000000
)
..
trackBorderColor
=
_showTrack
?
widget
.
trackBorderColor
??
const
Color
(
0x1a000000
)
:
const
Color
(
0x00000000
)
..
textDirection
=
Directionality
.
of
(
context
)
..
textDirection
=
Directionality
.
of
(
context
)
..
thickness
=
widget
.
thickness
??
_kScrollbarThickness
..
thickness
=
widget
.
thickness
??
_kScrollbarThickness
..
radius
=
widget
.
radius
..
radius
=
widget
.
radius
...
...
packages/flutter/test/widgets/scrollbar_test.dart
View file @
017fc6c9
...
@@ -2465,6 +2465,52 @@ void main() {
...
@@ -2465,6 +2465,52 @@ void main() {
);
);
});
});
testWidgets
(
'RawScrollbar correctly assigns colors'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
scrollController
=
ScrollController
();
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
PrimaryScrollController
(
controller:
scrollController
,
child:
RawScrollbar
(
thumbVisibility:
true
,
thumbColor:
const
Color
(
0xFFF44336
),
trackVisibility:
true
,
trackColor:
const
Color
(
0xFF2196F3
),
trackBorderColor:
const
Color
(
0xFFFFEB3B
),
controller:
scrollController
,
child:
const
SingleChildScrollView
(
child:
SizedBox
(
width:
4000.0
,
height:
4000.0
),
),
),
),
),
),
);
await
tester
.
pumpAndSettle
();
expect
(
scrollController
.
offset
,
0.0
);
expect
(
find
.
byType
(
RawScrollbar
),
paints
..
rect
(
rect:
const
Rect
.
fromLTRB
(
794.0
,
0.0
,
800.0
,
600.0
),
color:
const
Color
(
0xFF2196F3
),
)
..
line
(
p1:
const
Offset
(
794.0
,
0.0
),
p2:
const
Offset
(
794.0
,
600.0
),
strokeWidth:
1.0
,
color:
const
Color
(
0xFFFFEB3B
),
)
..
rect
(
rect:
const
Rect
.
fromLTRB
(
794.0
,
0.0
,
800.0
,
90.0
),
color:
const
Color
(
0xFFF44336
),
),
);
});
testWidgets
(
'trackRadius and radius properties of RawScrollbar can draw RoundedRectangularRect'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'trackRadius and radius properties of RawScrollbar can draw RoundedRectangularRect'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
scrollController
=
ScrollController
();
final
ScrollController
scrollController
=
ScrollController
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
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