Skip to content

Commit

Permalink
Merge pull request #12 from DevsOnFlutter/dev
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
divshekhar authored Dec 25, 2021
2 parents ffa72f3 + 0bb9afe commit cb797b0
Show file tree
Hide file tree
Showing 19 changed files with 314 additions and 233 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v1.3.0

* **Breaking Change** renamed `FlutterShortcutsItem` to `ShortcutItem`
* Extra fields added in ShortcutItem
* `(bool) conversationShortcut` make conversation shortcuts
* `(bool) isImportant` set conversation shortcut importance
* `(bool) isBot` set is conversation shortcut bot

## v1.2.2

* Compatibility added in Readme
Expand Down
69 changes: 53 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

![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)

## Compatibility
## Compatibility

&nbsp; Android </br>
&nbsp; iOS (active issue: [iOS support for quick actions](https://github.com/DevsOnFlutter/flutter_shortcuts/issues/1))
Expand All @@ -29,6 +29,7 @@ All the features listed below can be performed at the runtime.
&nbsp; Create Shortcuts </br>
&nbsp; Clear Shortcuts </br>
&nbsp; Update Shortcuts </br>
&nbsp; Conversation Shortcuts </br>
&nbsp; Use both flutter and android asset as shortcut icon </br>

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

```dart
FlutterShortcutItem(
ShortcutItem(
id: "2",
action: 'Bookmark page action',
shortLabel: 'Bookmark Page',
Expand All @@ -104,7 +105,7 @@ FlutterShortcutItem(
use: `ShortcutIconAsset.flutterAsset`

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

```dart
flutterShortcuts.setShortcutItems(
shortcutItems: <FlutterShortcutItem>[
const FlutterShortcutItem(
shortcutItems: <ShortcutItem>[
const ShortcutItem(
id: "1",
action: 'Home page action',
shortLabel: 'Home Page',
icon: 'assets/icons/home.png',
),
const FlutterShortcutItem(
const ShortcutItem(
id: "2",
action: 'Bookmark page action',
shortLabel: 'Bookmark Page',
Expand All @@ -151,7 +152,7 @@ Push a new shortcut item. If there is already a dynamic or pinned shortcut with

```dart
flutterShortcuts.pushShortcutItem(
shortcut: FlutterShortcutItem(
shortcut: ShortcutItem(
id: "5",
action: "Play Music Action",
shortLabel: "Play Music",
Expand All @@ -166,20 +167,20 @@ Pushes a list of shortcut item. If there is already a dynamic or pinned shortcut

```dart
flutterShortcuts.pushShortcutItems(
shortcutList: <FlutterShortcutItem>[
const FlutterShortcutItem(
shortcutList: <ShortcutItem>[
const ShortcutItem(
id: "1",
action: 'Home page new action',
shortLabel: 'Home Page',
icon: 'assets/icons/home.png',
),
const FlutterShortcutItem(
const ShortcutItem(
id: "2",
action: 'Bookmark page new action',
shortLabel: 'Bookmark Page',
icon: 'assets/icons/bookmark.png',
),
const FlutterShortcutItem(
const ShortcutItem(
id: "3",
action: 'Settings Action',
shortLabel: 'Setting',
Expand All @@ -195,7 +196,7 @@ Updates a single shortcut item based on id. If the ID of the shortcut is not sam

```dart
flutterShortcuts.updateShortcutItem(
shortcut: FlutterShortcutItem(
shortcut: ShortcutItem(
id: "1",
action: 'Go to url action',
shortLabel: 'Visit Page',
Expand All @@ -210,14 +211,14 @@ flutterShortcuts.updateShortcutItem(

```dart
flutterShortcuts.updateShortcutItems(
shortcutList: <FlutterShortcutItem>[
const FlutterShortcutItem(
shortcutList: <ShortcutItem>[
const ShortcutItem(
id: "1",
action: 'Resume playing Action',
shortLabel: 'Resume playing',
icon: 'assets/icons/play.png',
),
const FlutterShortcutItem(
const ShortcutItem(
id: "2",
action: 'Search Songs Action',
shortLabel: 'Search Songs',
Expand All @@ -227,6 +228,42 @@ flutterShortcuts.updateShortcutItems(
);
```

### Set Conversation Shortcut

Set `conversationShortcut: true` in ShortcutItem to make the shortcut as conversation shortcut.

The conversation shortcut can also be set as important and bot by setting `isImportant: true` & `isBot: true`.

```dart
await flutterShortcuts.pushShortcutItems(
shortcutList: <ShortcutItem>[
const ShortcutItem(
id: "1",
action: 'open_chat_1',
shortLabel: 'Divyanshu Shekhar',
icon: 'assets/icons/home.png',
conversationShortcut: true,
isImportant: true,
),
const ShortcutItem(
id: "2",
action: 'oepn_chat_2',
shortLabel: 'Subham Praharaj',
icon: 'assets/icons/bookmark.png',
conversationShortcut: true,
),
const ShortcutItem(
id: "3",
action: 'oepn_chat_3',
shortLabel: 'Auto Reply Bot',
icon: 'assets/icons/url.png',
conversationShortcut: true,
isBot: true,
),
],
);
```

### Change Shortcut Item Icon

Change the icon of the shortcut based on id. If the ID of the shortcut is not same, no changes will be reflected.
Expand Down Expand Up @@ -291,4 +328,4 @@ Describe the use-case.

## Copyright & License

Code and documentation Copyright (c) 2021 [Divyanshu Shekhar](https://divyanshushekhar.com). Code released under the [BSD 3-Clause License](./LICENSE).
Code and documentation Copyright (c) 2021 [Divyanshu Shekhar](https://hackthedeveloper.com). Code released under the [BSD 3-Clause License](./LICENSE).
4 changes: 2 additions & 2 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.8))
connection.project.dir=../example/android
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.1.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot
Expand Down
12 changes: 6 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ version '1.0'
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.0.4'
}
}

rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion 16
}
}

dependencies {
implementation "androidx.core:core:1.6.0-beta01"
implementation 'androidx.core:core-google-shortcuts:1.0.0-beta01'
implementation "androidx.core:core:1.8.0-alpha02"
implementation 'androidx.core:core-google-shortcuts:1.1.0-alpha01'
}
Loading

0 comments on commit cb797b0

Please sign in to comment.