Skip to content

Commit 1f2f51b

Browse files
committed
id removed from updateShortcutItem
1 parent 317ba47 commit 1f2f51b

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ class _MyAppState extends State<MyApp> {
179179
child: Text("Update Shortcut with ID"),
180180
onPressed: () {
181181
flutterShortcuts.updateShortcutItem(
182-
id: "1",
183182
shortcut: FlutterShortcutItem(
184183
id: "1",
185184
action: 'action updated with ID',

lib/flutter_shortcuts.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class FlutterShortcuts {
6868
/// [updateShortcutItem] updates a single shortcut item based on id.
6969
/// If the ID of the shortcut is not same, no changes will be reflected.
7070
Future<void> updateShortcutItem(
71-
{required String id, required FlutterShortcutItem shortcut}) async {
72-
return FlutterShortcutsPlatform.instance.updateShortcutItem(id, shortcut);
71+
{required FlutterShortcutItem shortcut}) async {
72+
return FlutterShortcutsPlatform.instance.updateShortcutItem(shortcut);
7373
}
7474

7575
// /// [updateShortLabel] updates short label of the shortcut item based on id.

lib/src/method_call/flutter_shortcuts_method_call_handler.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class FlutterShortcutsMethodCallHandler extends FlutterShortcutsPlatform {
7575
}
7676

7777
@override
78-
Future<void> updateShortcutItem(
79-
String id, FlutterShortcutItem shortcut) async {
78+
Future<void> updateShortcutItem(FlutterShortcutItem shortcut) async {
8079
final Map<String, String?> item = _serializeItem(shortcut);
8180
await channel.invokeMethod<void>('updateShortcutItem', [item]);
8281
}

lib/src/platform/flutter_shortcuts_platform.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ abstract class FlutterShortcutsPlatform extends PlatformInterface {
6060
throw UnimplementedError("updateShortcutItems() has not been implemented.");
6161
}
6262

63-
Future<void> updateShortcutItem(
64-
String id, FlutterShortcutItem shortcut) async {
63+
Future<void> updateShortcutItem(FlutterShortcutItem shortcut) async {
6564
throw UnimplementedError("updateShortcutItem() has not been implemented.");
6665
}
6766

0 commit comments

Comments
 (0)