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

outdatedDart 1 only

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
0
pub points
59%
popularity

Publisher

unverified uploader

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

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on launcher_assist