Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 65d827d

Browse files
author
xuyingjun
committed
v1.0.18 add color property for listRadio
1 parent 93a9b7b commit 65d827d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

β€Žexample/lib/dialog/listview_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ YYDialog YYListViewDialogListRadio() {
152152
items: radioItems,
153153
height: 370,
154154
intialValue: 2,
155+
color: Colors.white,
155156
activeColor: Colors.deepPurpleAccent,
156157
onClickItemListener: (index) {
157158
var radioItem = radioItems[index];

β€Žlib/flutter_custom_dialog.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ class YYDialog {
205205
YYDialog listViewOfRadioButton({
206206
List<RadioItem> items,
207207
double height,
208+
Color color,
208209
Color activeColor,
209210
int intialValue,
210211
Function(int) onClickItemListener,
@@ -221,6 +222,7 @@ class YYDialog {
221222
child: YYRadioListTile(
222223
items: items,
223224
intialValue: intialValue,
225+
color: color,
224226
activeColor: activeColor,
225227
onChanged: onClickItemListener,
226228
),
@@ -279,10 +281,11 @@ class YYDialog {
279281
padding: EdgeInsets.all(borderRadius / 3.14),
280282
width: width ?? null,
281283
height: height ?? null,
282-
decoration: decoration ?? BoxDecoration(
283-
borderRadius: BorderRadius.circular(borderRadius),
284-
color: backgroundColor,
285-
),
284+
decoration: decoration ??
285+
BoxDecoration(
286+
borderRadius: BorderRadius.circular(borderRadius),
287+
color: backgroundColor,
288+
),
286289
constraints: constraints ?? BoxConstraints(),
287290
child: CustomDialogChildren(
288291
widgetList: widgetList,

β€Žlib/flutter_custom_dialog_widget.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ class YYRadioListTile extends StatefulWidget {
88
Key key,
99
this.items,
1010
this.intialValue,
11+
this.color,
1112
this.activeColor,
1213
this.onChanged,
1314
}) : assert(items != null),
1415
super(key: key);
1516

1617
final List<RadioItem> items;
18+
final Color color;
1719
final Color activeColor;
1820
final intialValue;
1921
final Function(int) onChanged;
@@ -46,7 +48,7 @@ class YYRadioListTileState extends State<YYRadioListTile> {
4648
itemCount: widget.items.length,
4749
itemBuilder: (BuildContext context, int index) {
4850
return Material(
49-
color: Colors.white,
51+
color: widget.color,
5052
child: RadioListTile(
5153
title: Text(widget.items[index].text),
5254
value: index,

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /