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
48f56740
Unverified
Commit
48f56740
authored
Mar 09, 2021
by
Darren Austin
Committed by
GitHub
Mar 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed MaterialApp accentColor dependency. (#77652)
parent
99c75a73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
app.dart
packages/flutter/lib/src/material/app.dart
+1
-1
app_test.dart
packages/flutter/test/material/app_test.dart
+33
-0
No files found.
packages/flutter/lib/src/material/app.dart
View file @
48f56740
...
...
@@ -678,7 +678,7 @@ class _MaterialScrollBehavior extends ScrollBehavior {
return
GlowingOverscrollIndicator
(
child:
child
,
axisDirection:
axisDirection
,
color:
Theme
.
of
(
context
).
accentColor
,
color:
Theme
.
of
(
context
).
colorScheme
.
secondary
,
);
}
}
...
...
packages/flutter/test/material/app_test.dart
View file @
48f56740
...
...
@@ -9,6 +9,8 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'../rendering/mock_canvas.dart'
;
class
StateMarker
extends
StatefulWidget
{
const
StateMarker
({
Key
?
key
,
this
.
child
})
:
super
(
key:
key
);
...
...
@@ -882,6 +884,37 @@ void main() {
expect
(
themeAfterBrightnessChange
!.
brightness
,
Brightness
.
dark
);
});
testWidgets
(
'MaterialApp provides default overscroll color'
,
(
WidgetTester
tester
)
async
{
Future
<
void
>
slowDrag
(
WidgetTester
tester
,
Offset
start
,
Offset
offset
)
async
{
final
TestGesture
gesture
=
await
tester
.
startGesture
(
start
);
for
(
int
index
=
0
;
index
<
10
;
index
+=
1
)
{
await
gesture
.
moveBy
(
offset
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
20
));
}
await
gesture
.
up
();
}
// The overscroll color should be a transparent version of the colorScheme's
// secondary color.
const
Color
secondaryColor
=
Color
(
0xff008800
);
final
Color
glowSecondaryColor
=
secondaryColor
.
withOpacity
(
0.05
);
final
ThemeData
theme
=
ThemeData
.
from
(
colorScheme:
const
ColorScheme
.
light
().
copyWith
(
secondary:
secondaryColor
),
);
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
const
SingleChildScrollView
(
child:
SizedBox
(
height:
2000.0
),
),
),
);
final
RenderObject
painter
=
tester
.
renderObject
(
find
.
byType
(
CustomPaint
).
first
);
await
slowDrag
(
tester
,
const
Offset
(
200.0
,
200.0
),
const
Offset
(
0.0
,
5.0
));
expect
(
painter
,
paints
..
circle
(
color:
glowSecondaryColor
));
});
testWidgets
(
'MaterialApp can customize initial routes'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
<
NavigatorState
>
navigatorKey
=
GlobalKey
<
NavigatorState
>();
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