All Projects → DevsOnFlutter → flutter_shortcuts

DevsOnFlutter / flutter_shortcuts

Licence: BSD-3-Clause license
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Programming Languages

dart
5743 projects
java
68154 projects - #9 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to flutter shortcuts

Flutterexampleapps
[Example APPS] Basic Flutter apps, for flutter devs.
Stars: ✭ 15,950 (+33836.17%)
Mutual labels:  flutter-plugin
Flutter fluid slider
A fluid design slider that works just like the Slider material widget.
Stars: ✭ 232 (+393.62%)
Mutual labels:  flutter-plugin
flutter bolg manage
Flutter实战项目,采用Getx框架管理,遵循Material design设计风格,适合您实战参考或练手
Stars: ✭ 373 (+693.62%)
Mutual labels:  flutter-plugin
Flutter speed dial
Flutter plugin to implement a Material Design Speed Dial
Stars: ✭ 206 (+338.3%)
Mutual labels:  flutter-plugin
Flutter rating bar
A simple ratingbar for flutter which also include a rating bar indicator, supporting any fraction of rating.
Stars: ✭ 211 (+348.94%)
Mutual labels:  flutter-plugin
Sqfentity
SqfEntity ORM for Flutter/Dart lets you build and execute SQL commands on SQLite database easily and quickly with the help of fluent methods similar to .Net Entity Framework. SqfEntity also generates add/edit forms with validations and special controls (DropDown List, DateTime pickers, Checkboxes.. etc) for your table.
Stars: ✭ 237 (+404.26%)
Mutual labels:  flutter-plugin
Geolocation
Flutter geolocation plugin for Android and iOS.
Stars: ✭ 205 (+336.17%)
Mutual labels:  flutter-plugin
playify
Playify is a Flutter plugin for play/pause/seek songs, fetching music metadata, and browsing music library.
Stars: ✭ 32 (-31.91%)
Mutual labels:  flutter-plugin
Betterplayer
Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Stars: ✭ 205 (+336.17%)
Mutual labels:  flutter-plugin
Shortbread
Android library that creates app shortcuts from annotations
Stars: ✭ 1,803 (+3736.17%)
Mutual labels:  app-shortcuts
Scratcher
Scratch card widget which temporarily hides content from user.
Stars: ✭ 210 (+346.81%)
Mutual labels:  flutter-plugin
Flutter plugin record
flutter 仿微信录制语音功能 支持android和ios
Stars: ✭ 214 (+355.32%)
Mutual labels:  flutter-plugin
Flutter Nfc Reader
Flutter NFC reader plugin for iOS and Android
Stars: ✭ 240 (+410.64%)
Mutual labels:  flutter-plugin
Awesome Fluttercn
一份 Flutter 优秀中文资源列表,在这里能找到优质的Flutter库、工具,教程,文章等。
Stars: ✭ 208 (+342.55%)
Mutual labels:  flutter-plugin
firebase dart sdk
Unofficial Firebase Flutter SDK. Maintainer: @long1eu
Stars: ✭ 84 (+78.72%)
Mutual labels:  flutter-plugin
Plugins
Plugins for Flutter maintained by the Flutter team
Stars: ✭ 14,956 (+31721.28%)
Mutual labels:  flutter-plugin
Flip box bar
A 3D Bottom Navigation Bar in Flutter
Stars: ✭ 236 (+402.13%)
Mutual labels:  flutter-plugin
flutter wechat
flutter wechat
Stars: ✭ 76 (+61.7%)
Mutual labels:  flutter-plugin
FlutterToastPlugin
A new Flutter plugin for showing toast in android and ios.
Stars: ✭ 21 (-55.32%)
Mutual labels:  flutter-plugin
nativescript-app-shortcuts
👇 Home Icon Actions for your NativeScript app, now also for Android!
Stars: ✭ 45 (-4.26%)
Mutual labels:  app-shortcuts

Flutter Shortcuts

GitHub GitHub code size in bytes GitHub top language GitHub language count GitHub tag (latest by date) GitHub issues GitHub Repo stars GitHub forks

Compatibility

  Android
  iOS (active issue: iOS support for quick actions)

Show some ❤️ and the repo

Why use Flutter Shortcuts?

Flutter Shortcuts Plugin is known for :

Flutter Shortcuts
Fast, performant & compatible
Free & Open-source
Production ready
Make App Reactive

Features

All the features listed below can be performed at the runtime.

  Create Shortcuts
  Clear Shortcuts
  Update Shortcuts
  Conversation Shortcuts
  Use both flutter and android asset as shortcut icon

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(debug: true);

Example

Define Shortcut Action

flutterShortcuts.listenAction((String incomingAction) {
    setState(() {
    if (incomingAction != null) {
        action = incomingAction;
    }
  });
});

Get Max Shortcut Limit

Return the maximum number of static and dynamic shortcuts that each launcher icon can have at a time.

int? result = await flutterShortcuts.getMaxShortcutLimit();

Shortcut Icon Asset

Flutter Shortcuts allows you to create shortcut icon from both android drawable or mipmap and flutter Assets.

  • If you want to use icon from Android resources, drawable or mipmap.

use: ShortcutIconAsset.androidAsset

ShortcutItem(
  id: "2",
  action: 'Bookmark page action',
  shortLabel: 'Bookmark Page',
  icon: "ic_launcher",
  shortcutIconAsset: ShortcutIconAsset.androidAsset,
),
  • If you want to create shortcut icon from flutter asset. (DEFAULT)

use: ShortcutIconAsset.flutterAsset

ShortcutItem(
  id: "2",
  action: 'Bookmark page action',
  shortLabel: 'Bookmark Page',
  icon: 'assets/icons/bookmark.png',
  shortcutIconAsset: ShortcutIconAsset.flutterAsset,
),

Set shortcut items

Publishes the list of shortcuts. All existing shortcuts will be replaced.

flutterShortcuts.setShortcutItems(
  shortcutItems: <ShortcutItem>[
    const ShortcutItem(
      id: "1",
      action: 'Home page action',
      shortLabel: 'Home Page',
      icon: 'assets/icons/home.png',
    ),
    const ShortcutItem(
      id: "2",
      action: 'Bookmark page action',
      shortLabel: 'Bookmark Page',
      icon: "ic_launcher",
      shortcutIconAsset: ShortcutIconAsset.androidAsset,
    ),
  ],
),

Clear shortcut item

Delete all dynamic shortcuts from the app.

flutterShortcuts.clearShortcutItems();

Push Shortcut Item

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.

flutterShortcuts.pushShortcutItem(
  shortcut: ShortcutItem(
    id: "5",
    action: "Play Music Action",
    shortLabel: "Play Music",
    icon: 'assets/icons/music.png',
  ),
);

Push Shortcut Items

Pushes a list of 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.

flutterShortcuts.pushShortcutItems(
  shortcutList: <ShortcutItem>[
    const ShortcutItem(
      id: "1",
      action: 'Home page new action',
      shortLabel: 'Home Page',
      icon: 'assets/icons/home.png',
    ),
    const ShortcutItem(
      id: "2",
      action: 'Bookmark page new action',
      shortLabel: 'Bookmark Page',
      icon: 'assets/icons/bookmark.png',
    ),
    const ShortcutItem(
      id: "3",
      action: 'Settings Action',
      shortLabel: 'Setting',
      icon: 'assets/icons/settings.png',
    ),
  ],
);

Update Shortcut Item

Updates a single shortcut item based on id. If the ID of the shortcut is not same, no changes will be reflected.

flutterShortcuts.updateShortcutItem(
  shortcut: ShortcutItem(
    id: "1",
    action: 'Go to url action',
    shortLabel: 'Visit Page',
    icon: 'assets/icons/url.png',
  ),
);

Update Shortcut Items

Updates shortcut items. If the IDs of the shortcuts are not same, no changes will be reflected.

flutterShortcuts.updateShortcutItems(
 shortcutList: <ShortcutItem>[
   const ShortcutItem(
     id: "1",
     action: 'Resume playing Action',
     shortLabel: 'Resume playing',
     icon: 'assets/icons/play.png',
   ),
   const ShortcutItem(
     id: "2",
     action: 'Search Songs Action',
     shortLabel: 'Search Songs',
     icon: 'assets/icons/search.png',
   ),
 ],
);

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.

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.

flutterShortcuts.changeShortcutItemIcon(
  id: "2",
  icon: "assets/icons/next.png",
);

Get shortcut icon properties

Get the icon properties of your shortcut icon.

Map<String, int> result = await flutterShortcuts.getIconProperties();
print( "maxHeight: ${result["maxHeight"]}, maxWidth: ${result["maxWidth"]}");

Project Created & Maintained By

Divyanshu Shekhar

GitHub followers

Subham Praharaj

GitHub followers

Contributions

Contributions are welcomed!

If you feel that a hook is missing, feel free to open a pull-request.

For a custom-hook to be merged, you will need to do the following:

Describe the use-case.

  • Open an issue explaining why we need this hook, how to use it, ... This is important as a hook will not get merged if the hook doens't appeal to a large number of people.

  • If your hook is rejected, don't worry! A rejection doesn't mean that it won't be merged later in the future if more people shows an interest in it. In the mean-time, feel free to publish your hook as a package on https://pub.dev.

  • A hook will not be merged unles fully tested, to avoid breaking it inadvertendly in the future.

Stargazers

Stargazers repo roster for @DevsOnFlutter/flutter_shortcuts

Forkers

Forkers repo roster for @DevsOnFlutter/flutter_shortcuts

Copyright & License

Code and documentation Copyright (c) 2021 Divyanshu Shekhar. Code released under the BSD 3-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].