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
0478cbec
Unverified
Commit
0478cbec
authored
Mar 01, 2021
by
Hans Muller
Committed by
GitHub
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed RadioListTile accentColor dependency (#76906)
parent
8d866d9c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
radio_list_tile.dart
packages/flutter/lib/src/material/radio_list_tile.dart
+8
-6
radio_list_tile_test.dart
packages/flutter/test/material/radio_list_tile_test.dart
+36
-0
No files found.
packages/flutter/lib/src/material/radio_list_tile.dart
View file @
0478cbec
...
@@ -26,11 +26,13 @@ import 'theme_data.dart';
...
@@ -26,11 +26,13 @@ import 'theme_data.dart';
/// those of the same name on [ListTile].
/// those of the same name on [ListTile].
///
///
/// The [selected] property on this widget is similar to the [ListTile.selected]
/// The [selected] property on this widget is similar to the [ListTile.selected]
/// property, but the color used is that described by [activeColor], if any,
/// property. This tile's [activeColor] is used for the selected item's text color, or
/// defaulting to the accent color of the current [Theme]. No effort is made to
/// the theme's [ThemeData.toggleableActiveColor] if [activeColor] is null.
/// coordinate the [selected] state and the [checked] state; to have the list
///
/// tile appear selected when the radio button is the selected radio button, set
/// This widget does not coordinate the [selected] state and the
/// [selected] to true when [value] matches [groupValue].
/// [checked] state; to have the list tile appear selected when the
/// radio button is the selected radio button, set [selected] to true
/// when [value] matches [groupValue].
///
///
/// The radio button is shown on the left by default in left-to-right languages
/// The radio button is shown on the left by default in left-to-right languages
/// (i.e. the leading edge). This can be changed using [controlAffinity]. The
/// (i.e. the leading edge). This can be changed using [controlAffinity]. The
...
@@ -520,7 +522,7 @@ class RadioListTile<T> extends StatelessWidget {
...
@@ -520,7 +522,7 @@ class RadioListTile<T> extends StatelessWidget {
}
}
return
MergeSemantics
(
return
MergeSemantics
(
child:
ListTileTheme
.
merge
(
child:
ListTileTheme
.
merge
(
selectedColor:
activeColor
??
Theme
.
of
(
context
).
accent
Color
,
selectedColor:
activeColor
??
Theme
.
of
(
context
).
toggleableActive
Color
,
child:
ListTile
(
child:
ListTile
(
leading:
leading
,
leading:
leading
,
title:
title
,
title:
title
,
...
...
packages/flutter/test/material/radio_list_tile_test.dart
View file @
0478cbec
...
@@ -707,4 +707,40 @@ void main() {
...
@@ -707,4 +707,40 @@ void main() {
expect
(
find
.
byType
(
Material
),
paints
..
path
(
color:
selectedTileColor
));
expect
(
find
.
byType
(
Material
),
paints
..
path
(
color:
selectedTileColor
));
});
});
testWidgets
(
'RadioListTile selected item text Color'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/pull/76906
const
Color
activeColor
=
Color
(
0xff00ff00
);
Widget
buildFrame
({
Color
?
activeColor
,
Color
?
toggleableActiveColor
})
{
return
MaterialApp
(
theme:
ThemeData
.
light
().
copyWith
(
toggleableActiveColor:
toggleableActiveColor
,
),
home:
Scaffold
(
body:
Center
(
child:
RadioListTile
<
bool
>(
activeColor:
activeColor
,
selected:
true
,
title:
const
Text
(
'title'
),
value:
false
,
groupValue:
true
,
onChanged:
(
bool
?
newValue
)
{
},
),
),
),
);
}
Color
?
textColor
(
String
text
)
{
return
tester
.
renderObject
<
RenderParagraph
>(
find
.
text
(
text
)).
text
.
style
?.
color
;
}
await
tester
.
pumpWidget
(
buildFrame
(
toggleableActiveColor:
activeColor
));
expect
(
textColor
(
'title'
),
activeColor
);
await
tester
.
pumpWidget
(
buildFrame
(
activeColor:
activeColor
));
expect
(
textColor
(
'title'
),
activeColor
);
});
}
}
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