FLUTTER ECOSYSTEM

hathibelagal-dev/launcher-assist-for-flutter

一个简化 Android 启动器开发的 Flutter 包

flutter-启动器助手 项目封面
Stars
22
Forks
15
最近推送(UTC)
2020年5月12日
项目状态
已归档
Ashraff Hathibelagal GitHub avatar
GITHUB User

Ashraff Hathibelagal ↗

Embrace the Future, Become a Cyborg 🦾

语言JavaDart

技术话题

此仓库发布的插件

使用的依赖

依赖清单 1 项
  • flutter{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Launcher Assist

This is a Flutter plugin that gives you basic access to Android's PackageManager and WallpaperManager classes. As such, it is designed to help you build launchers for Android. Currently, it offers the following methods:

  • getAllApps() - This method returns a map containing the labels, package names, and icons of all the launchable apps installed on a user's device. The icons are available as byte arrays.

  • launchApp() - Takes a package name as its only argument. As its name suggests, it lets you launch apps.

  • getWallpaper() - Returns the current wallpaper of the user, as a byte array that you can directly pass to the Image.memory() method. Note that on devices running Android Oreo or higher, this method will work only if your app has the READ_EXTERNAL_STORAGE permission.

Usage

To use this plugin, add launcher_assist as a dependency in your pubspec.yaml file.

Sample Code
import 'package:launcher_assist/launcher_assist.dart';

.
.
.

// Get all apps
LauncherAssist.getAllApps().then((apps) {
    setState(() {
        numberOfInstalledApps = apps.length;
        installedApps = apps;
    });
});