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
aec2985c
Unverified
Commit
aec2985c
authored
Mar 11, 2021
by
Darren Austin
Committed by
GitHub
Mar 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed RefreshIndicator accentColor dependency. (#77884)
parent
38393291
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
refresh_indicator.dart
packages/flutter/lib/src/material/refresh_indicator.dart
+5
-5
refresh_indicator_test.dart
packages/flutter/test/material/refresh_indicator_test.dart
+36
-0
No files found.
packages/flutter/lib/src/material/refresh_indicator.dart
View file @
aec2985c
...
@@ -147,7 +147,7 @@ class RefreshIndicator extends StatefulWidget {
...
@@ -147,7 +147,7 @@ class RefreshIndicator extends StatefulWidget {
final
RefreshCallback
onRefresh
;
final
RefreshCallback
onRefresh
;
/// The progress indicator's foreground color. The current theme's
/// The progress indicator's foreground color. The current theme's
/// [
ThemeData.accentColor
] by default.
/// [
ColorScheme.primary
] by default.
final
Color
?
color
;
final
Color
?
color
;
/// The progress indicator's background color. The current theme's
/// The progress indicator's background color. The current theme's
...
@@ -229,8 +229,8 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
...
@@ -229,8 +229,8 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ThemeData
theme
=
Theme
.
of
(
context
);
_valueColor
=
_positionController
.
drive
(
_valueColor
=
_positionController
.
drive
(
ColorTween
(
ColorTween
(
begin:
(
widget
.
color
??
theme
.
accentColor
).
withOpacity
(
0.0
),
begin:
(
widget
.
color
??
theme
.
colorScheme
.
primary
).
withOpacity
(
0.0
),
end:
(
widget
.
color
??
theme
.
accentColor
).
withOpacity
(
1.0
),
end:
(
widget
.
color
??
theme
.
colorScheme
.
primary
).
withOpacity
(
1.0
),
).
chain
(
CurveTween
(
).
chain
(
CurveTween
(
curve:
const
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
curve:
const
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
)),
)),
...
@@ -245,8 +245,8 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
...
@@ -245,8 +245,8 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ThemeData
theme
=
Theme
.
of
(
context
);
_valueColor
=
_positionController
.
drive
(
_valueColor
=
_positionController
.
drive
(
ColorTween
(
ColorTween
(
begin:
(
widget
.
color
??
theme
.
accentColor
).
withOpacity
(
0.0
),
begin:
(
widget
.
color
??
theme
.
colorScheme
.
primary
).
withOpacity
(
0.0
),
end:
(
widget
.
color
??
theme
.
accentColor
).
withOpacity
(
1.0
),
end:
(
widget
.
color
??
theme
.
colorScheme
.
primary
).
withOpacity
(
1.0
),
).
chain
(
CurveTween
(
).
chain
(
CurveTween
(
curve:
const
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
curve:
const
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
)),
)),
...
...
packages/flutter/test/material/refresh_indicator_test.dart
View file @
aec2985c
...
@@ -709,6 +709,42 @@ void main() {
...
@@ -709,6 +709,42 @@ void main() {
expect
(
refreshCalled
,
false
);
expect
(
refreshCalled
,
false
);
});
});
testWidgets
(
'RefreshIndicator color defaults to ColorScheme.primary'
,
(
WidgetTester
tester
)
async
{
const
Color
primaryColor
=
Color
(
0xff4caf50
);
final
ThemeData
theme
=
ThemeData
.
from
(
colorScheme:
const
ColorScheme
.
light
().
copyWith
(
primary:
primaryColor
));
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
stateSetter
)
{
return
RefreshIndicator
(
triggerMode:
RefreshIndicatorTriggerMode
.
anywhere
,
onRefresh:
holdRefresh
,
child:
ListView
(
reverse:
true
,
physics:
const
AlwaysScrollableScrollPhysics
(),
children:
const
<
Widget
>[
SizedBox
(
height:
200.0
,
child:
Text
(
'X'
),
),
SizedBox
(
height:
800.0
,
child:
Text
(
'Y'
),
),
],
),
);
},
),
),
);
await
tester
.
fling
(
find
.
text
(
'X'
),
const
Offset
(
0.0
,
-
300.0
),
1000.0
);
await
tester
.
pump
();
expect
(
tester
.
widget
<
RefreshProgressIndicator
>(
find
.
byType
(
RefreshProgressIndicator
)).
valueColor
!.
value
,
primaryColor
);
});
testWidgets
(
'RefreshIndicator.color can be updated at runtime'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'RefreshIndicator.color can be updated at runtime'
,
(
WidgetTester
tester
)
async
{
refreshCalled
=
false
;
refreshCalled
=
false
;
Color
refreshIndicatorColor
=
Colors
.
green
;
Color
refreshIndicatorColor
=
Colors
.
green
;
...
...
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