@@ -22,8 +22,8 @@ class ShortcutItem {
2222 ///
2323 /// Only [icon] should be nullable. It will remain `null` if unset.
2424 const ShortcutItem ({
25- @ required this .type,
26- @ required this .localizedTitle,
25+ required this .type,
26+ required this .localizedTitle,
2727 this .icon,
2828 });
2929
@@ -35,7 +35,7 @@ class ShortcutItem {
3535
3636 /// Name of native resource (xcassets etc; NOT a Flutter asset) to be
3737 /// displayed as the icon for this item.
38- final String icon;
38+ final String ? icon;
3939}
4040
4141/// Quick actions plugin.
@@ -65,15 +65,16 @@ class QuickActions {
6565 assert (call.method == 'launch' );
6666 handler (call.arguments);
6767 });
68- final String action = await channel.invokeMethod <String >('getLaunchAction' );
68+ final String ? action =
69+ await channel.invokeMethod <String ?>('getLaunchAction' );
6970 if (action != null ) {
7071 handler (action);
7172 }
7273 }
7374
7475 /// Sets the [ShortcutItem] s to become the app's quick actions.
7576 Future <void > setShortcutItems (List <ShortcutItem > items) async {
76- final List <Map <String , String >> itemsList =
77+ final List <Map <String , String ? >> itemsList =
7778 items.map (_serializeItem).toList ();
7879 await channel.invokeMethod <void >('setShortcutItems' , itemsList);
7980 }
@@ -82,8 +83,8 @@ class QuickActions {
8283 Future <void > clearShortcutItems () =>
8384 channel.invokeMethod <void >('clearShortcutItems' );
8485
85- Map <String , String > _serializeItem (ShortcutItem item) {
86- return < String , String > {
86+ Map <String , String ? > _serializeItem (ShortcutItem item) {
87+ return < String , String ? > {
8788 'type' : item.type,
8889 'localizedTitle' : item.localizedTitle,
8990 'icon' : item.icon,
0 commit comments