Skip to content

Commit 0bb9afe

Browse files
committed
v1.3.0
1 parent 6b5c20b commit 0bb9afe

File tree

5 files changed

+81
-36
lines changed

5 files changed

+81
-36
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v1.3.0
2+
3+
* **Breaking Change** renamed `FlutterShortcutsItem` to `ShortcutItem`
4+
* Extra fields added in ShortcutItem
5+
* `(bool) conversationShortcut` make conversation shortcuts
6+
* `(bool) isImportant` set conversation shortcut importance
7+
* `(bool) isBot` set is conversation shortcut bot
8+
19
## v1.2.2
210

311
* Compatibility added in Readme

README.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![GitHub](https://img.shields.io/github/license/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub top language](https://img.shields.io/github/languages/top/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub language count](https://img.shields.io/github/languages/count/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/DevsOnFlutter/flutter_shortcuts?style=plastic) ![GitHub Repo stars](https://img.shields.io/github/stars/DevsOnFlutter/flutter_shortcuts?style=social) ![GitHub forks](https://img.shields.io/github/forks/DevsOnFlutter/flutter_shortcuts?style=social)
66

7-
## Compatibility
7+
## Compatibility
88

99
&nbsp; Android </br>
1010
&nbsp; 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.
2929
&nbsp; Create Shortcuts </br>
3030
&nbsp; Clear Shortcuts </br>
3131
&nbsp; Update Shortcuts </br>
32+
&nbsp; Conversation Shortcuts </br>
3233
&nbsp; Use both flutter and android asset as shortcut icon </br>
3334

3435
## Demo
@@ -90,7 +91,7 @@ Flutter Shortcuts allows you to create shortcut icon from both android `drawable
9091
use: `ShortcutIconAsset.androidAsset`
9192

9293
```dart
93-
FlutterShortcutItem(
94+
ShortcutItem(
9495
id: "2",
9596
action: 'Bookmark page action',
9697
shortLabel: 'Bookmark Page',
@@ -104,7 +105,7 @@ FlutterShortcutItem(
104105
use: `ShortcutIconAsset.flutterAsset`
105106

106107
```dart
107-
FlutterShortcutItem(
108+
ShortcutItem(
108109
id: "2",
109110
action: 'Bookmark page action',
110111
shortLabel: 'Bookmark Page',
@@ -119,14 +120,14 @@ Publishes the list of shortcuts. All existing shortcuts will be replaced.
119120

120121
```dart
121122
flutterShortcuts.setShortcutItems(
122-
shortcutItems: <FlutterShortcutItem>[
123-
const FlutterShortcutItem(
123+
shortcutItems: <ShortcutItem>[
124+
const ShortcutItem(
124125
id: "1",
125126
action: 'Home page action',
126127
shortLabel: 'Home Page',
127128
icon: 'assets/icons/home.png',
128129
),
129-
const FlutterShortcutItem(
130+
const ShortcutItem(
130131
id: "2",
131132
action: 'Bookmark page action',
132133
shortLabel: 'Bookmark Page',
@@ -151,7 +152,7 @@ Push a new shortcut item. If there is already a dynamic or pinned shortcut with
151152

152153
```dart
153154
flutterShortcuts.pushShortcutItem(
154-
shortcut: FlutterShortcutItem(
155+
shortcut: ShortcutItem(
155156
id: "5",
156157
action: "Play Music Action",
157158
shortLabel: "Play Music",
@@ -166,20 +167,20 @@ Pushes a list of shortcut item. If there is already a dynamic or pinned shortcut
166167

167168
```dart
168169
flutterShortcuts.pushShortcutItems(
169-
shortcutList: <FlutterShortcutItem>[
170-
const FlutterShortcutItem(
170+
shortcutList: <ShortcutItem>[
171+
const ShortcutItem(
171172
id: "1",
172173
action: 'Home page new action',
173174
shortLabel: 'Home Page',
174175
icon: 'assets/icons/home.png',
175176
),
176-
const FlutterShortcutItem(
177+
const ShortcutItem(
177178
id: "2",
178179
action: 'Bookmark page new action',
179180
shortLabel: 'Bookmark Page',
180181
icon: 'assets/icons/bookmark.png',
181182
),
182-
const FlutterShortcutItem(
183+
const ShortcutItem(
183184
id: "3",
184185
action: 'Settings Action',
185186
shortLabel: 'Setting',
@@ -195,7 +196,7 @@ Updates a single shortcut item based on id. If the ID of the shortcut is not sam
195196

196197
```dart
197198
flutterShortcuts.updateShortcutItem(
198-
shortcut: FlutterShortcutItem(
199+
shortcut: ShortcutItem(
199200
id: "1",
200201
action: 'Go to url action',
201202
shortLabel: 'Visit Page',
@@ -210,14 +211,14 @@ flutterShortcuts.updateShortcutItem(
210211

211212
```dart
212213
flutterShortcuts.updateShortcutItems(
213-
shortcutList: <FlutterShortcutItem>[
214-
const FlutterShortcutItem(
214+
shortcutList: <ShortcutItem>[
215+
const ShortcutItem(
215216
id: "1",
216217
action: 'Resume playing Action',
217218
shortLabel: 'Resume playing',
218219
icon: 'assets/icons/play.png',
219220
),
220-
const FlutterShortcutItem(
221+
const ShortcutItem(
221222
id: "2",
222223
action: 'Search Songs Action',
223224
shortLabel: 'Search Songs',
@@ -227,6 +228,42 @@ flutterShortcuts.updateShortcutItems(
227228
);
228229
```
229230

231+
### Set Conversation Shortcut
232+
233+
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+
230267
### Change Shortcut Item Icon
231268

232269
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.
291328

292329
## Copyright & License
293330

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).

example/lib/main.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ class _MyAppState extends State<MyApp> {
7676
child: Text("Set Shortcuts"),
7777
onPressed: () async {
7878
await flutterShortcuts.setShortcutItems(
79-
shortcutItems: <FlutterShortcutItem>[
80-
const FlutterShortcutItem(
79+
shortcutItems: <ShortcutItem>[
80+
const ShortcutItem(
8181
id: "1",
8282
action: 'Home page action',
8383
shortLabel: 'Home Page',
8484
icon: 'assets/icons/home.png',
8585
),
86-
const FlutterShortcutItem(
86+
const ShortcutItem(
8787
id: "2",
8888
action: 'Bookmark page action',
8989
shortLabel: 'Bookmark Page',
@@ -118,7 +118,7 @@ class _MyAppState extends State<MyApp> {
118118
child: Text("push Shortcut Item"),
119119
onPressed: () async {
120120
await flutterShortcuts.pushShortcutItem(
121-
shortcut: FlutterShortcutItem(
121+
shortcut: ShortcutItem(
122122
id: "5",
123123
action: "Play Music Action",
124124
shortLabel: "Play Music",
@@ -131,14 +131,14 @@ class _MyAppState extends State<MyApp> {
131131
child: Text("Update all shortcuts"),
132132
onPressed: () async {
133133
await flutterShortcuts.updateShortcutItems(
134-
shortcutList: <FlutterShortcutItem>[
135-
const FlutterShortcutItem(
134+
shortcutList: <ShortcutItem>[
135+
const ShortcutItem(
136136
id: "1",
137137
action: 'Resume playing Action',
138138
shortLabel: 'Resume playing',
139139
icon: 'assets/icons/play.png',
140140
),
141-
const FlutterShortcutItem(
141+
const ShortcutItem(
142142
id: "2",
143143
action: 'Search Songs Action',
144144
shortLabel: 'Search Songs',
@@ -157,20 +157,20 @@ class _MyAppState extends State<MyApp> {
157157
child: Text("Add Shortcut"),
158158
onPressed: () async {
159159
await flutterShortcuts.pushShortcutItems(
160-
shortcutList: <FlutterShortcutItem>[
161-
const FlutterShortcutItem(
160+
shortcutList: <ShortcutItem>[
161+
const ShortcutItem(
162162
id: "1",
163163
action: 'Home page new action',
164164
shortLabel: 'Home Page',
165165
icon: 'assets/icons/home.png',
166166
),
167-
const FlutterShortcutItem(
167+
const ShortcutItem(
168168
id: "2",
169169
action: 'Bookmark page new action',
170170
shortLabel: 'Bookmark Page',
171171
icon: 'assets/icons/bookmark.png',
172172
),
173-
const FlutterShortcutItem(
173+
const ShortcutItem(
174174
id: "3",
175175
action: 'Settings Action',
176176
shortLabel: 'Setting',
@@ -184,7 +184,7 @@ class _MyAppState extends State<MyApp> {
184184
child: Text("Update Shortcut with ID"),
185185
onPressed: () {
186186
flutterShortcuts.updateShortcutItem(
187-
shortcut: FlutterShortcutItem(
187+
shortcut: ShortcutItem(
188188
id: "1",
189189
action: 'Go to url action',
190190
shortLabel: 'Visit Page',
@@ -228,24 +228,24 @@ class _MyAppState extends State<MyApp> {
228228
ElevatedButton(
229229
child: Text("Set conversation Shortcut"),
230230
onPressed: () async {
231-
await flutterShortcuts.pushShortcutItems(
232-
shortcutList: <FlutterShortcutItem>[
233-
const FlutterShortcutItem(
231+
await flutterShortcuts.setShortcutItems(
232+
shortcutItems: <ShortcutItem>[
233+
const ShortcutItem(
234234
id: "1",
235235
action: 'open_chat_1',
236236
shortLabel: 'Divyanshu Shekhar',
237237
icon: 'assets/icons/home.png',
238238
conversationShortcut: true,
239239
isImportant: true,
240240
),
241-
const FlutterShortcutItem(
241+
const ShortcutItem(
242242
id: "2",
243243
action: 'oepn_chat_2',
244244
shortLabel: 'Subham Praharaj',
245245
icon: 'assets/icons/bookmark.png',
246246
conversationShortcut: true,
247247
),
248-
const FlutterShortcutItem(
248+
const ShortcutItem(
249249
id: "3",
250250
action: 'oepn_chat_3',
251251
shortLabel: 'Auto Reply Bot',

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ packages:
6868
path: ".."
6969
relative: true
7070
source: path
71-
version: "1.2.2"
71+
version: "1.3.0"
7272
flutter_test:
7373
dependency: "direct dev"
7474
description: flutter

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_shortcuts
2-
description: Flutter plugin for creating static & dynamic app shortcuts on home screen.
3-
version: 1.2.2
2+
description: Flutter plugin for creating static & dynamic app/conversation shortcuts on home screen.
3+
version: 1.3.0
44
repository: https://github.com/DevsOnFlutter/flutter_shortcuts
55
documentation: https://github.com/DevsOnFlutter/flutter_shortcuts/blob/main/README.md
66

0 commit comments

Comments
 (0)