launcher_assist 1.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 30

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() - Return the current wallpaper of the user, as a byte array that you can directly pass to the Image.memory() method.

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;
    });
});

[0.0.1] - March 19, 2018

  • Initial release

[0.0.4] - March 19, 2018

  • Updated README and example code.

[0.0.5] - March 20, 2018

  • Fixed minor analysis issues.

[1.0.0] - March 20, 2018

  • Removed all Base64 encoding/decoding code.

[1.0.2] - March 20, 2018

  • Updated README and example code.

[1.0.4] - March 24, 2018

  • Fix for Android Oreo devices having instant apps

example/lib/main.dart

// Copyright 2017 Ashraff Hathibelagal.
// Use of this source code is governed by an Apache license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:launcher_assist/launcher_assist.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  var numberOfInstalledApps;
  var installedApps;
  var wallpaper;

  @override
  initState() {
    super.initState();

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

    // Get wallpaper as binary data
    LauncherAssist.getWallpaper().then((imageData) {
      setState(() {
        wallpaper = imageData;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
          appBar: new AppBar(
            title: new Text('Launcher Assist'),
          ),
          body: new Column(children: <Widget>[
            new Text("Found $numberOfInstalledApps apps installed"),
            new RaisedButton(
                child: new Text("Launch Something"),
                onPressed: () {
                  // Launch the first app available
                  LauncherAssist.launchApp(installedApps[0]["package"]);
                }),
            wallpaper != null
                ? new Image.memory(wallpaper, fit: BoxFit.scaleDown)
                : new Center()
          ])),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  launcher_assist: ^1.0.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:launcher_assist/launcher_assist.dart';
  
Version Uploaded Documentation Archive
1.0.4 Mar 24, 2018 Go to the documentation of launcher_assist 1.0.4 Download launcher_assist 1.0.4 archive
1.0.3 Mar 19, 2018 Go to the documentation of launcher_assist 1.0.3 Download launcher_assist 1.0.3 archive
1.0.2 Mar 19, 2018 Go to the documentation of launcher_assist 1.0.2 Download launcher_assist 1.0.2 archive
1.0.1 Mar 19, 2018 Go to the documentation of launcher_assist 1.0.1 Download launcher_assist 1.0.1 archive
1.0.0 Mar 19, 2018 Go to the documentation of launcher_assist 1.0.0 Download launcher_assist 1.0.0 archive
0.0.5 Mar 19, 2018 Go to the documentation of launcher_assist 0.0.5 Download launcher_assist 0.0.5 archive
0.0.4 Mar 19, 2018 Go to the documentation of launcher_assist 0.0.4 Download launcher_assist 0.0.4 archive
0.0.3 Mar 19, 2018 Go to the documentation of launcher_assist 0.0.3 Download launcher_assist 0.0.3 archive
0.0.2 Mar 19, 2018 Go to the documentation of launcher_assist 0.0.2 Download launcher_assist 0.0.2 archive
0.0.1 Mar 19, 2018 Go to the documentation of launcher_assist 0.0.1 Download launcher_assist 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
30
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0