File tree Expand file tree Collapse file tree 6 files changed +31
-8
lines changed Expand file tree Collapse file tree 6 files changed +31
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.2
2
+
3
+ - Change SheetAction's icon to nullable
4
+
1
5
## 0.1.1
2
6
3
7
- Add documentation
Original file line number Diff line number Diff line change @@ -72,6 +72,23 @@ class _SheetPageState extends State<SheetPage> {
72
72
logger.info (result);
73
73
},
74
74
),
75
+ ListTile (
76
+ title: const Text ('Title/Message (No Icon)' ),
77
+ onTap: () async {
78
+ final result = await showModalActionSheet <String >(
79
+ context: context,
80
+ title: 'Title' ,
81
+ message: 'Message' ,
82
+ actions: const [
83
+ SheetAction (
84
+ label: 'Hello' ,
85
+ key: 'helloKey' ,
86
+ ),
87
+ ],
88
+ );
89
+ logger.info (result);
90
+ },
91
+ ),
75
92
ListTile (
76
93
title: const Text ('Default action' ),
77
94
onTap: () async {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ packages:
7
7
path: ".."
8
8
relative: true
9
9
source: path
10
- version: "0.1.0+3 "
10
+ version: "0.1.2 "
11
11
archive:
12
12
dependency: transitive
13
13
description:
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ Future<T> showAlertDialog<T>({
41
41
label: a.label,
42
42
isDefaultAction: a.isDefaultAction,
43
43
isDestructiveAction: a.isDestructiveAction,
44
- icon: null ,
45
44
))
46
45
.toList (),
47
46
style: style,
Original file line number Diff line number Diff line change @@ -70,13 +70,16 @@ Future<T> showModalActionSheet<T>({
70
70
],
71
71
...actions.map (
72
72
(a) {
73
+ final icon = a.icon;
73
74
final color =
74
75
a.isDestructiveAction ? colorScheme.error : null ;
75
76
return ListTile (
76
- leading: Icon (
77
- a.icon,
78
- color: color,
79
- ),
77
+ leading: icon == null
78
+ ? null
79
+ : Icon (
80
+ icon,
81
+ color: color,
82
+ ),
80
83
title: Text (
81
84
a.label,
82
85
style: TextStyle (
@@ -98,8 +101,8 @@ Future<T> showModalActionSheet<T>({
98
101
class SheetAction <T > {
99
102
const SheetAction ({
100
103
@required this .label,
101
- @required this .icon,
102
104
this .key,
105
+ this .icon,
103
106
this .isDefaultAction = false ,
104
107
this .isDestructiveAction = false ,
105
108
});
Original file line number Diff line number Diff line change 1
1
name : adaptive_dialog
2
2
description : Show alert dialog or modal action sheet adaptively according to platform.
3
- version : 0.1.1
3
+ version : 0.1.2
4
4
homepage : https://github.com/mono0926/adaptive_dialog
5
5
environment :
6
6
sdk : " >=2.6.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments