flutter_shortcuts 1.0.0 flutter_shortcuts: ^1.0.0 copied to clipboard
Flutter plugin for creating static & dynamic app shortcuts on home screen.
Flutter Shortcuts #
Show some ❤️ and ⭐ the repo #
Demo #
Quick Start #
Step 1: Include plugin to your project #
dependencies:
flutter_shortcuts: <latest version>
Run pub get and get packages.
Step 2: Instantiate Flutter Shortcuts Plugin #
final FlutterShortcuts flutterShortcuts = FlutterShortcuts();
Step 3: Initialize Flutter Shortcuts #
flutterShortcuts.initialize((String incomingAction) {
setState(() {
if (incomingAction != null) {
action = incomingAction;
}
});
});
Arguments #
There are several function that allow for more control:
Properties | Description |
---|---|
initialize |
performs action when shortcut is initiated. |
getMaxShortcutLimit |
returns the maximum number of static or dynamic shortcuts that each launcher icon can have at a time. |
setShortcutItems |
will set all the shortcut items. |
clearShortcutItems |
will remove all the shortcut items. |
pushShortcutItem |
will push a new shortcut item.If there is already a dynamic or pinned shortcut with the same ID, the shortcut will be updated and pushed at the end of the shortcut list. |
addShortcutItems |
updates dynamic or pinned shortcuts with same IDs and pushes new shortcuts with different IDs. |
updateShortcutItems |
updates shortcut items. If the IDs of the shortcuts are not same, no changes will be reflected. |
updateShortcutItem |
updates a single shortcut item based on id. If the ID of the shortcut is not same, no changes will be reflected. |
changeShortcutItemIcon |
will change the icon of the shortcut based on id.s If the ID of the shortcut is not same, no changes will be reflected. |
Project Created & Maintained By #
Divyanshu Shekhar #
Subham Praharaj #
Copyright & License #
Code and documentation Copyright (c) 2021 Divyanshu Shekhar. Code released under the BSD 3-Clause License.