launcher_assist 1.1.3 copy "launcher_assist: ^1.1.3" to clipboard
launcher_assist: ^1.1.3 copied to clipboard

This plugin makes it easy for you to create launcher apps for Android with Flutter. Not supported on iOS.

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()
          ])),
    );
  }
}
29
likes
30
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

This plugin makes it easy for you to create launcher apps for Android with Flutter. Not supported on iOS.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on launcher_assist