Skip to content

Commit cb797b0

Browse files
authored
Merge pull request #12 from DevsOnFlutter/dev
v1.3.0
2 parents ffa72f3 + 0bb9afe commit cb797b0

File tree

19 files changed

+314
-233
lines changed

19 files changed

+314
-233
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).

android/.settings/org.eclipse.buildship.core.prefs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
arguments=
22
auto.sync=false
33
build.scans.enabled=false
4-
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.8))
5-
connection.project.dir=../example/android
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.1.1))
5+
connection.project.dir=
66
eclipse.preferences.version=1
77
gradle.user.home=
88
java.home=C\:/Program Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot

android/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ version '1.0'
44
buildscript {
55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.1.0'
11+
classpath 'com.android.tools.build:gradle:7.0.4'
1212
}
1313
}
1414

1515
rootProject.allprojects {
1616
repositories {
1717
google()
18-
jcenter()
18+
mavenCentral()
1919
}
2020
}
2121

2222
apply plugin: 'com.android.library'
2323

2424
android {
25-
compileSdkVersion 30
25+
compileSdkVersion 31
2626

2727
defaultConfig {
2828
minSdkVersion 16
2929
}
3030
}
3131

3232
dependencies {
33-
implementation "androidx.core:core:1.6.0-beta01"
34-
implementation 'androidx.core:core-google-shortcuts:1.0.0-beta01'
33+
implementation "androidx.core:core:1.8.0-alpha02"
34+
implementation 'androidx.core:core-google-shortcuts:1.1.0-alpha01'
3535
}

0 commit comments

Comments
 (0)