Skip to content

Commit b21494e

Browse files
committed
bug fixes
1 parent 961dfb1 commit b21494e

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,42 @@
88

99
[![GitHub followers](https://img.shields.io/github/followers/divshekhar.svg?style=social&label=Follow)](https://github.com/divshekhar/)
1010

11+
## Quick Start
12+
13+
### Step 1: Include plugin to your project
14+
15+
```yml
16+
dependencies:
17+
flutter_shortcuts: <latest version>
18+
```
19+
20+
Run pub get and get packages.
21+
22+
### Step 2: Instantiate Flutter Shortcuts Plugin
23+
24+
```dart
25+
final FlutterShortcuts flutterShortcuts = FlutterShortcuts();
26+
```
27+
28+
### Step 3: Initialize Flutter Shortcuts
29+
30+
```dart
31+
flutterShortcuts.initialize((String incomingAction) {
32+
setState(() {
33+
if (incomingAction != null) {
34+
action = incomingAction;
35+
}
36+
});
37+
});
38+
```
39+
1140
## Arguments
1241

13-
There are several options that allow for more control:
42+
There are several function that allow for more control:
1443

1544
| Properties | Description |
1645
|--------------|-----------------|
17-
| `initialize` | performs action when shortcut is initiated. |
46+
| `initialize` | performs action when shortcut is initiated.|
1847
| `getMaxShortcutLimit` | returns the maximum number of static or dynamic shortcuts that each launcher icon can have at a time. |
1948
| `setShortcutItems` | will set all the shortcut items. |
2049
| `clearShortcutItems` | will remove all the shortcut items.|
@@ -32,7 +61,7 @@ There are several options that allow for more control:
3261

3362
### Subham Praharaj
3463

35-
<a href="https://twitter.com/SubhamPraharaj6"><img src="https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true" width="60"></a> <a href="https://instagram.com/the_champ_subham_865"><img src="https://github.com/aritraroy/social-icons/blob/master/instagram-icon.png?raw=true" width="60"></a>
64+
<a href="https://twitter.com/SubhamPraharaj6"><img src="https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true" width="60"></a> <a href="https://www.linkedin.com/in/subham-praharaj-66b172179/"><img src="https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true" width="60"></a> <a href="https://instagram.com/the_champ_subham_865"><img src="https://github.com/aritraroy/social-icons/blob/master/instagram-icon.png?raw=true" width="60"></a>
3665

3766
## Copyright & License
3867

android/src/main/java/com/divyanshushekhar/flutter_shortcuts/MethodCallImplementation.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@
33
import android.app.Activity;
44
import android.content.Context;
55
import android.content.Intent;
6-
import android.content.pm.LauncherApps;
76
import android.content.pm.ShortcutInfo;
87
import android.content.pm.ShortcutManager;
98
import android.content.res.Resources;
10-
import android.graphics.drawable.Drawable;
119
import android.graphics.drawable.Icon;
1210
import android.os.Build;
13-
import android.os.PersistableBundle;
1411
import android.util.Log;
15-
import android.widget.Toast;
1612

1713
import androidx.annotation.NonNull;
1814
import androidx.annotation.RequiresApi;
1915

20-
import java.io.InputStream;
2116
import java.util.ArrayList;
2217
import java.util.HashMap;
2318
import java.util.List;
@@ -133,7 +128,6 @@ private void setShortcutItems(MethodCall call,ShortcutManager shortcutManager) {
133128
} catch (Exception e) {
134129
Log.e(TAG,e.toString());
135130
}
136-
Toast.makeText(context, "Shortcut Created", Toast.LENGTH_SHORT).show();
137131
}
138132

139133
@RequiresApi(api = Build.VERSION_CODES.N_MR1)

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class _MyAppState extends State<MyApp> {
1818
@override
1919
void initState() {
2020
super.initState();
21-
2221
flutterShortcuts.initialize((String incomingAction) {
2322
setState(() {
2423
if (incomingAction != null) {

0 commit comments

Comments
 (0)