You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-16Lines changed: 53 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5

6
6
7
-
## Compatibility
7
+
## Compatibility
8
8
9
9
✅   Android </br>
10
10
❌   iOS (active issue: [iOS support for quick actions](https://github.com/DevsOnFlutter/flutter_shortcuts/issues/1))
@@ -29,6 +29,7 @@ All the features listed below can be performed at the runtime.
29
29
✅   Create Shortcuts </br>
30
30
✅   Clear Shortcuts </br>
31
31
✅   Update Shortcuts </br>
32
+
✅   Conversation Shortcuts </br>
32
33
✅   Use both flutter and android asset as shortcut icon </br>
33
34
34
35
## Demo
@@ -90,7 +91,7 @@ Flutter Shortcuts allows you to create shortcut icon from both android `drawable
90
91
use: `ShortcutIconAsset.androidAsset`
91
92
92
93
```dart
93
-
FlutterShortcutItem(
94
+
ShortcutItem(
94
95
id: "2",
95
96
action: 'Bookmark page action',
96
97
shortLabel: 'Bookmark Page',
@@ -104,7 +105,7 @@ FlutterShortcutItem(
104
105
use: `ShortcutIconAsset.flutterAsset`
105
106
106
107
```dart
107
-
FlutterShortcutItem(
108
+
ShortcutItem(
108
109
id: "2",
109
110
action: 'Bookmark page action',
110
111
shortLabel: 'Bookmark Page',
@@ -119,14 +120,14 @@ Publishes the list of shortcuts. All existing shortcuts will be replaced.
119
120
120
121
```dart
121
122
flutterShortcuts.setShortcutItems(
122
-
shortcutItems: <FlutterShortcutItem>[
123
-
const FlutterShortcutItem(
123
+
shortcutItems: <ShortcutItem>[
124
+
const ShortcutItem(
124
125
id: "1",
125
126
action: 'Home page action',
126
127
shortLabel: 'Home Page',
127
128
icon: 'assets/icons/home.png',
128
129
),
129
-
const FlutterShortcutItem(
130
+
const ShortcutItem(
130
131
id: "2",
131
132
action: 'Bookmark page action',
132
133
shortLabel: 'Bookmark Page',
@@ -151,7 +152,7 @@ Push a new shortcut item. If there is already a dynamic or pinned shortcut with
151
152
152
153
```dart
153
154
flutterShortcuts.pushShortcutItem(
154
-
shortcut: FlutterShortcutItem(
155
+
shortcut: ShortcutItem(
155
156
id: "5",
156
157
action: "Play Music Action",
157
158
shortLabel: "Play Music",
@@ -166,20 +167,20 @@ Pushes a list of shortcut item. If there is already a dynamic or pinned shortcut
166
167
167
168
```dart
168
169
flutterShortcuts.pushShortcutItems(
169
-
shortcutList: <FlutterShortcutItem>[
170
-
const FlutterShortcutItem(
170
+
shortcutList: <ShortcutItem>[
171
+
const ShortcutItem(
171
172
id: "1",
172
173
action: 'Home page new action',
173
174
shortLabel: 'Home Page',
174
175
icon: 'assets/icons/home.png',
175
176
),
176
-
const FlutterShortcutItem(
177
+
const ShortcutItem(
177
178
id: "2",
178
179
action: 'Bookmark page new action',
179
180
shortLabel: 'Bookmark Page',
180
181
icon: 'assets/icons/bookmark.png',
181
182
),
182
-
const FlutterShortcutItem(
183
+
const ShortcutItem(
183
184
id: "3",
184
185
action: 'Settings Action',
185
186
shortLabel: 'Setting',
@@ -195,7 +196,7 @@ Updates a single shortcut item based on id. If the ID of the shortcut is not sam
Set `conversationShortcut: true` in ShortcutItem to make the shortcut as conversation shortcut.
234
+
235
+
The conversation shortcut can also be set as important and bot by setting `isImportant: true` & `isBot: true`.
236
+
237
+
```dart
238
+
await flutterShortcuts.pushShortcutItems(
239
+
shortcutList: <ShortcutItem>[
240
+
const ShortcutItem(
241
+
id: "1",
242
+
action: 'open_chat_1',
243
+
shortLabel: 'Divyanshu Shekhar',
244
+
icon: 'assets/icons/home.png',
245
+
conversationShortcut: true,
246
+
isImportant: true,
247
+
),
248
+
const ShortcutItem(
249
+
id: "2",
250
+
action: 'oepn_chat_2',
251
+
shortLabel: 'Subham Praharaj',
252
+
icon: 'assets/icons/bookmark.png',
253
+
conversationShortcut: true,
254
+
),
255
+
const ShortcutItem(
256
+
id: "3",
257
+
action: 'oepn_chat_3',
258
+
shortLabel: 'Auto Reply Bot',
259
+
icon: 'assets/icons/url.png',
260
+
conversationShortcut: true,
261
+
isBot: true,
262
+
),
263
+
],
264
+
);
265
+
```
266
+
230
267
### Change Shortcut Item Icon
231
268
232
269
Change the icon of the shortcut based on id. If the ID of the shortcut is not same, no changes will be reflected.
@@ -291,4 +328,4 @@ Describe the use-case.
291
328
292
329
## Copyright & License
293
330
294
-
Code and documentation Copyright (c) 2021 [Divyanshu Shekhar](https://divyanshushekhar.com). Code released under the [BSD 3-Clause License](./LICENSE).
331
+
Code and documentation Copyright (c) 2021 [Divyanshu Shekhar](https://hackthedeveloper.com). Code released under the [BSD 3-Clause License](./LICENSE).
0 commit comments