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
4feefa3c
Unverified
Commit
4feefa3c
authored
Mar 14, 2019
by
rami-a
Committed by
GitHub
Mar 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Material] Fix radio ink ripple to be centered (#28845)
parent
25820ab2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
radio.dart
packages/flutter/lib/src/material/radio.dart
+1
-1
radio_test.dart
packages/flutter/test/material/radio_test.dart
+36
-0
No files found.
packages/flutter/lib/src/material/radio.dart
View file @
4feefa3c
...
...
@@ -214,7 +214,7 @@ class _RenderRadio extends RenderToggleable {
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
final
Canvas
canvas
=
context
.
canvas
;
paintRadialReaction
(
canvas
,
offset
,
const
Offset
(
kRadialReactionRadius
,
kRadialReactionRadius
));
paintRadialReaction
(
canvas
,
offset
,
size
.
center
(
Offset
.
zero
));
final
Offset
center
=
(
offset
&
size
).
center
;
final
Color
radioColor
=
onChanged
!=
null
?
activeColor
:
inactiveColor
;
...
...
packages/flutter/test/material/radio_test.dart
View file @
4feefa3c
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
show
Platform
;
import
'dart:ui'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -245,5 +246,40 @@ void main() {
semantics
.
dispose
();
SystemChannels
.
accessibility
.
setMockMessageHandler
(
null
);
});
testWidgets
(
'Radio ink ripple is displayed correctly'
,
(
WidgetTester
tester
)
async
{
final
Key
painterKey
=
UniqueKey
();
const
Key
radioKey
=
Key
(
'radio'
);
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(),
home:
Scaffold
(
body:
RepaintBoundary
(
key:
painterKey
,
child:
Center
(
child:
Container
(
width:
100
,
height:
100
,
color:
Colors
.
white
,
child:
Radio
<
int
>(
key:
radioKey
,
value:
1
,
groupValue:
1
,
onChanged:
(
int
value
)
{},
),
)
),
),
),
));
await
tester
.
press
(
find
.
byKey
(
radioKey
));
await
tester
.
pumpAndSettle
();
await
expectLater
(
find
.
byKey
(
painterKey
),
matchesGoldenFile
(
'radio.ink_ripple.png'
),
skip:
!
Platform
.
isLinux
,
);
});
}
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