Skip to content

Commit f8f71e9

Browse files
committed
Bump up version
1 parent 77013cc commit f8f71e9

File tree

6 files changed

+31
-8
lines changed

6 files changed

+31
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.2
2+
3+
- Change SheetAction's icon to nullable
4+
15
## 0.1.1
26

37
- Add documentation

example/lib/pages/sheet_page.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,23 @@ class _SheetPageState extends State<SheetPage> {
7272
logger.info(result);
7373
},
7474
),
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+
),
7592
ListTile(
7693
title: const Text('Default action'),
7794
onTap: () async {

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.1.0+3"
10+
version: "0.1.2"
1111
archive:
1212
dependency: transitive
1313
description:

lib/src/alert_dialog.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Future<T> showAlertDialog<T>({
4141
label: a.label,
4242
isDefaultAction: a.isDefaultAction,
4343
isDestructiveAction: a.isDestructiveAction,
44-
icon: null,
4544
))
4645
.toList(),
4746
style: style,

lib/src/modal_action_sheet.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ Future<T> showModalActionSheet<T>({
7070
],
7171
...actions.map(
7272
(a) {
73+
final icon = a.icon;
7374
final color =
7475
a.isDestructiveAction ? colorScheme.error : null;
7576
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+
),
8083
title: Text(
8184
a.label,
8285
style: TextStyle(
@@ -98,8 +101,8 @@ Future<T> showModalActionSheet<T>({
98101
class SheetAction<T> {
99102
const SheetAction({
100103
@required this.label,
101-
@required this.icon,
102104
this.key,
105+
this.icon,
103106
this.isDefaultAction = false,
104107
this.isDestructiveAction = false,
105108
});

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: adaptive_dialog
22
description: Show alert dialog or modal action sheet adaptively according to platform.
3-
version: 0.1.1
3+
version: 0.1.2
44
homepage: https://github.com/mono0926/adaptive_dialog
55
environment:
66
sdk: ">=2.6.0 <3.0.0"

0 commit comments

Comments
 (0)