Skip to content

Commit 76998cb

Browse files
Merge pull request #28 from slavap/master
decoration param added; warnings eliminated.
2 parents 3b455b5 + 2f3d02d commit 76998cb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/flutter_custom_dialog.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class YYDialog {
1717
bool gravityAnimationEnable = false; //弹窗出现的位置带有的默认动画是否可用
1818
Color barrierColor = Colors.black.withOpacity(.3); //弹窗外的背景色
1919
Color backgroundColor = Colors.white; //弹窗内的背景色
20+
Decoration decoration;
2021
double borderRadius = 0.0; //弹窗圆角
2122
BoxConstraints constraints; //弹窗约束
2223
Function(Widget child, Animation<double> animation) animatedFunc; //弹窗出现的动画
@@ -275,7 +276,7 @@ class YYDialog {
275276
padding: EdgeInsets.all(borderRadius / 3.14),
276277
width: width ?? null,
277278
height: height ?? null,
278-
decoration: BoxDecoration(
279+
decoration: decoration ?? BoxDecoration(
279280
borderRadius: BorderRadius.circular(borderRadius),
280281
color: backgroundColor,
281282
),
@@ -384,10 +385,10 @@ class YYDialog {
384385

385386
///弹窗的内容作为可变组件
386387
class CustomDialogChildren extends StatefulWidget {
387-
List<Widget> widgetList = []; //弹窗内部所有组件
388-
Function(bool) isShowingChange;
388+
final List<Widget> widgetList; //弹窗内部所有组件
389+
final Function(bool) isShowingChange;
389390

390-
CustomDialogChildren({this.widgetList, this.isShowingChange});
391+
CustomDialogChildren({this.widgetList = const [], this.isShowingChange});
391392

392393
@override
393394
CustomDialogChildState createState() => CustomDialogChildState();

lib/flutter_custom_dialog_widget.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class YYRadioListTile extends StatefulWidget {
1212
}) : assert(items != null),
1313
super(key: key);
1414

15-
List<RadioItem> items;
16-
Color activeColor;
17-
Function(int) onChanged;
15+
final List<RadioItem> items;
16+
final Color activeColor;
17+
final Function(int) onChanged;
1818

1919
@override
2020
State<StatefulWidget> createState() {

0 commit comments

Comments
 (0)