패키지, 저장소 및 앱 카테고리 검색

flutter_shortcuts 표지
패키지 상세v1.3.0

flutter_shortcuts

홈 화면에 정적 및 동적 앱/대화 단축키를 생성하기 위한 플러터 플러그인입니다.

AndroidiOS
30일 다운로드
63
좋아요
147
Pub 점수
140

패키지 설치

flutter pub add flutter_shortcuts

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter Shortcuts는 Android 및 iOS의 홈 화면에서 앱과 대화의 정적 및 동적 바로가기를 생성할 수 있도록 해주는 플러그인입니다. 사용자는 기기의 홈 화면에서 앱 내 특정 기능이나 대화에 빠르게 접근할 수 있게 되어 사용자 경험과 참여도를 향상시킵니다. 이 플러그인은 Flutter 앱과 원활하게 통합되며, 두 플랫폼 전용 바로가기 유형을 모두 지원합니다. 개발자는 프로그래밍 방식 또는 구성 파일을 통해 바로가기를 정적으로 정의할 수 있어, 맥락 인식 작업을 쉽게 구현할 수 있습니다. 네이티브 OS 바로가기 기능을 활용함으로써 가시성과 사용성을 강화합니다.

사용 사례

  • 앱 내 기능에 빠르게 접근
  • 대화 스레드로 직접 탐색
  • 사용자 생산성 향상
  • 홈 화면에서의 심층 링크 활성화
  • 컨텍스트 작업 지원

주요 기능

  • 정적 및 동적 단축키를 지원합니다
  • 크로스 플랫폼(안드로이드 및 iOS)
  • Flutter와의 간편한 통합
  • 네이티브 OS 단축키 렌더링
  • 코드 또는 매니페스트를 통해 구성 가능
  • 컨텍스트 인식 단축키 생성

적합한 대상

  • 빠른 기능 접근이 필요한 앱
  • 메시징 또는 채팅 애플리케이션
  • 생산성 도구
  • 사용자 중심 설계 구현
  • Android 및 iOS를 대상으로 하는 개발자

고려 사항

  • 완전한 기능을 위해 플랫폼별 설정이 필요합니다
  • 동적 단축키는 새로 고침 로직이 필요할 수 있습니다
  • Android에 비해 iOS의 사용자 맞춤 설정이 제한적
  • 권한 및 사용자 동의 처리
  • 물리적 장치에서 테스트하는 것이 권장됩니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter 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 :heart: and :star: 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.

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.0

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.