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
96a770bd
Unverified
Commit
96a770bd
authored
Sep 23, 2022
by
MH Johnson
Committed by
GitHub
Sep 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Material] Remove "down position" from toggleable ripple calculation (#112209)
* remove down position from toggleable ripple
parent
4beceb8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
toggleable.dart
packages/flutter/lib/src/material/toggleable.dart
+1
-2
checkbox_test.dart
packages/flutter/test/material/checkbox_test.dart
+32
-0
No files found.
packages/flutter/lib/src/material/toggleable.dart
View file @
96a770bd
...
...
@@ -559,7 +559,6 @@ abstract class ToggleablePainter extends ChangeNotifier implements CustomPainter
focusColor
,
reactionFocusFade
.
value
,
)!;
final
Offset
center
=
Offset
.
lerp
(
downPosition
??
origin
,
origin
,
reaction
.
value
)!;
final
Animatable
<
double
>
radialReactionRadiusTween
=
Tween
<
double
>(
begin:
0.0
,
end:
splashRadius
,
...
...
@@ -568,7 +567,7 @@ abstract class ToggleablePainter extends ChangeNotifier implements CustomPainter
?
splashRadius
:
radialReactionRadiusTween
.
evaluate
(
reaction
);
if
(
reactionRadius
>
0.0
)
{
canvas
.
drawCircle
(
center
+
offset
,
reactionRadius
,
reactionPaint
);
canvas
.
drawCircle
(
origin
+
offset
,
reactionRadius
,
reactionPaint
);
}
}
}
...
...
packages/flutter/test/material/checkbox_test.dart
View file @
96a770bd
...
...
@@ -602,6 +602,38 @@ void main() {
);
});
testWidgets
(
'Checkbox starts the splash in center, even when tap is on the corner'
,
(
WidgetTester
tester
)
async
{
Widget
buildApp
()
{
return
MaterialApp
(
theme:
theme
,
home:
Material
(
child:
Center
(
child:
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
Checkbox
(
value:
false
,
onChanged:
(
bool
?
newValue
)
{},
);
}),
),
),
);
}
await
tester
.
pumpWidget
(
buildApp
());
final
Offset
checkboxTopLeftGlobal
=
tester
.
getTopLeft
(
find
.
byType
(
Checkbox
));
final
Offset
checkboxCenterGlobal
=
tester
.
getCenter
(
find
.
byType
(
Checkbox
));
final
Offset
checkboxCenterLocal
=
checkboxCenterGlobal
-
checkboxTopLeftGlobal
;
await
tester
.
startGesture
(
checkboxTopLeftGlobal
);
await
tester
.
pump
();
// Wait for the splash to be drawn, but not long enough for it to animate towards the center, since
// we want to catch it in its starting position.
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
expect
(
Material
.
of
(
tester
.
element
(
find
.
byType
(
Checkbox
))),
paints
..
circle
(
x:
checkboxCenterLocal
.
dx
,
y:
checkboxCenterLocal
.
dy
),
);
});
testWidgets
(
'Checkbox can be hovered and has correct hover color'
,
(
WidgetTester
tester
)
async
{
tester
.
binding
.
focusManager
.
highlightStrategy
=
FocusHighlightStrategy
.
alwaysTraditional
;
bool
?
value
=
true
;
...
...
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