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
d90a2464
Unverified
Commit
d90a2464
authored
Jul 16, 2020
by
Hans Muller
Committed by
GitHub
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected splash color for TextButton, ElevatedButton, OutlinedButton (#61576)
parent
fc09119d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
ink_well.dart
packages/flutter/lib/src/material/ink_well.dart
+4
-1
elevated_button_test.dart
packages/flutter/test/material/elevated_button_test.dart
+8
-2
outlined_button_test.dart
packages/flutter/test/material/outlined_button_test.dart
+7
-2
text_button_test.dart
packages/flutter/test/material/text_button_test.dart
+8
-2
No files found.
packages/flutter/lib/src/material/ink_well.dart
View file @
d90a2464
...
...
@@ -1071,7 +1071,10 @@ class _InkResponseState extends State<_InkResponseStateWidget>
for
(
final
_HighlightType
type
in
_highlights
.
keys
)
{
_highlights
[
type
]?.
color
=
getHighlightColorForType
(
type
);
}
_currentSplash
?.
color
=
widget
.
splashColor
??
Theme
.
of
(
context
).
splashColor
;
const
Set
<
MaterialState
>
pressed
=
<
MaterialState
>{
MaterialState
.
pressed
};
_currentSplash
?.
color
=
widget
.
overlayColor
?.
resolve
(
pressed
)
??
widget
.
splashColor
??
Theme
.
of
(
context
).
splashColor
;
final
MouseCursor
effectiveMouseCursor
=
MaterialStateProperty
.
resolveAs
<
MouseCursor
>(
widget
.
mouseCursor
??
MaterialStateMouseCursor
.
clickable
,
<
MaterialState
>{
...
...
packages/flutter/test/material/elevated_button_test.dart
View file @
d90a2464
...
...
@@ -50,8 +50,11 @@ void main() {
expect
(
material
.
type
,
MaterialType
.
button
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
ElevatedButton
));
await
tester
.
startGesture
(
center
);
await
tester
.
pumpAndSettle
();
final
TestGesture
gesture
=
await
tester
.
startGesture
(
center
);
await
tester
.
pump
();
// start the splash animation
await
tester
.
pump
(
const
Duration
(
milliseconds:
100
));
// splash is underway
final
RenderObject
inkFeatures
=
tester
.
allRenderObjects
.
firstWhere
((
RenderObject
object
)
=>
object
.
runtimeType
.
toString
()
==
'_RenderInkFeatures'
);
expect
(
inkFeatures
,
paints
..
circle
(
color:
colorScheme
.
onPrimary
.
withAlpha
(
0x3d
)));
// splash color is onPrimary(0.24)
// Only elevation changes when enabled and pressed.
material
=
tester
.
widget
<
Material
>(
rawButtonMaterial
);
...
...
@@ -69,6 +72,9 @@ void main() {
expect
(
material
.
textStyle
.
fontWeight
,
FontWeight
.
w500
);
expect
(
material
.
type
,
MaterialType
.
button
);
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
// Disabled ElevatedButton
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/material/outlined_button_test.dart
View file @
d90a2464
...
...
@@ -56,9 +56,14 @@ void main() {
expect
(
material
.
type
,
MaterialType
.
button
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
OutlinedButton
));
await
tester
.
startGesture
(
center
);
await
tester
.
pumpAndSettle
();
final
TestGesture
gesture
=
await
tester
.
startGesture
(
center
);
await
tester
.
pump
();
// start the splash animation
await
tester
.
pump
(
const
Duration
(
milliseconds:
100
));
// splash is underway
final
RenderObject
inkFeatures
=
tester
.
allRenderObjects
.
firstWhere
((
RenderObject
object
)
=>
object
.
runtimeType
.
toString
()
==
'_RenderInkFeatures'
);
expect
(
inkFeatures
,
paints
..
circle
(
color:
colorScheme
.
primary
.
withAlpha
(
0x1f
)));
// splash color is primary(0.12)
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
// No change vs enabled and not pressed.
material
=
tester
.
widget
<
Material
>(
rawButtonMaterial
);
expect
(
material
.
animationDuration
,
const
Duration
(
milliseconds:
200
));
...
...
packages/flutter/test/material/text_button_test.dart
View file @
d90a2464
...
...
@@ -50,9 +50,14 @@ void main() {
expect
(
material
.
type
,
MaterialType
.
button
);
final
Offset
center
=
tester
.
getCenter
(
find
.
byType
(
TextButton
));
await
tester
.
startGesture
(
center
);
await
tester
.
pumpAndSettle
();
final
TestGesture
gesture
=
await
tester
.
startGesture
(
center
);
await
tester
.
pump
();
// start the splash animation
await
tester
.
pump
(
const
Duration
(
milliseconds:
100
));
// splash is underway
final
RenderObject
inkFeatures
=
tester
.
allRenderObjects
.
firstWhere
((
RenderObject
object
)
=>
object
.
runtimeType
.
toString
()
==
'_RenderInkFeatures'
);
expect
(
inkFeatures
,
paints
..
circle
(
color:
colorScheme
.
primary
.
withAlpha
(
0x1f
)));
// splash color is primary(0.12)
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
material
=
tester
.
widget
<
Material
>(
buttonMaterial
);
// No change vs enabled and not pressed.
expect
(
material
.
animationDuration
,
const
Duration
(
milliseconds:
200
));
...
...
@@ -969,6 +974,7 @@ void main() {
);
expect
(
paddingWidget
.
padding
,
const
EdgeInsets
.
all
(
22
));
});
}
...
...
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