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
abfaec68
Unverified
Commit
abfaec68
authored
Oct 19, 2022
by
Oleg
Committed by
GitHub
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ScrollbarTheme instead Theme for Scrollbar (#113237)
parent
3d94b8fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
scrollbar.dart
packages/flutter/lib/src/material/scrollbar.dart
+1
-1
scrollbar_theme_test.dart
packages/flutter/test/material/scrollbar_theme_test.dart
+44
-0
No files found.
packages/flutter/lib/src/material/scrollbar.dart
View file @
abfaec68
...
@@ -399,7 +399,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {
...
@@ -399,7 +399,7 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {
void
didChangeDependencies
()
{
void
didChangeDependencies
()
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ThemeData
theme
=
Theme
.
of
(
context
);
_colorScheme
=
theme
.
colorScheme
;
_colorScheme
=
theme
.
colorScheme
;
_scrollbarTheme
=
theme
.
scrollbarTheme
;
_scrollbarTheme
=
ScrollbarTheme
.
of
(
context
)
;
switch
(
theme
.
platform
)
{
switch
(
theme
.
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android
:
_useAndroidScrollbar
=
true
;
_useAndroidScrollbar
=
true
;
...
...
packages/flutter/test/material/scrollbar_theme_test.dart
View file @
abfaec68
...
@@ -206,6 +206,50 @@ void main() {
...
@@ -206,6 +206,50 @@ void main() {
}),
}),
);
);
testWidgets
(
'Scrollbar uses values from ScrollbarTheme if exists instead of values from Theme'
,
(
WidgetTester
tester
)
async
{
final
ScrollbarThemeData
scrollbarTheme
=
_scrollbarTheme
();
final
ScrollController
scrollController
=
ScrollController
();
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
scrollbarTheme:
scrollbarTheme
,
),
home:
ScrollConfiguration
(
behavior:
const
NoScrollbarBehavior
(),
child:
ScrollbarTheme
(
data:
_scrollbarTheme
().
copyWith
(
thumbColor:
MaterialStateProperty
.
all
(
const
Color
(
0xFF000000
)),
),
child:
Scrollbar
(
thumbVisibility:
true
,
controller:
scrollController
,
child:
SingleChildScrollView
(
controller:
scrollController
,
child:
const
SizedBox
(
width:
4000.0
,
height:
4000.0
),
),
),
),
),
),
);
await
tester
.
pumpAndSettle
();
// Idle scrollbar behavior
expect
(
find
.
byType
(
Scrollbar
),
paints
..
rrect
(
rrect:
RRect
.
fromRectAndRadius
(
const
Rect
.
fromLTRB
(
785.0
,
10.0
,
795.0
,
97.0
),
const
Radius
.
circular
(
6.0
),
),
color:
const
Color
(
0xFF000000
),
),
);
},
);
testWidgets
(
'ScrollbarTheme can disable gestures'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ScrollbarTheme can disable gestures'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
scrollController
=
ScrollController
();
final
ScrollController
scrollController
=
ScrollController
();
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
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