flutter_package_manager 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 58

Package Manager for Android #

This plugin offers the ability of android's PackageManager. You can retrieve the app name, app launcher icon through this package with its package name. The package should be installed on a device.

This plugin supports android only and it is based on androidx.

How to use #

See the ./example and ./lib folders for the details.

Modify minSdkVersion of the android gradle #

In the android/app folder open the build.gradle file and edit minSdkVersion to greater than or equal to 22.

Get package information from the package name #

import 'package:flutter_package_manager/flutter_package_manager.dart';

/// ... other codes

Future<PackageInfo> getPackageInfo() async {
  final PackageInfo info =
    await FlutterPackageManager.getPackageInfo('com.facebook.katana');
  return info;
}

PackageInfo class contains packageName, appName and appIconByteArray. appIconByteArray is an array of base64 byte image of app icon. You can get flutter's Image widget icon by appIcon getter. If the app is not installed, than null is returned.

Get package names of the all applications installed on the device #

import 'package:flutter_package_manager/flutter_package_manager.dart';

/// ... other codes

Future<List> getInstalledPackages() async {
  List packages = await FlutterPackageManager.getInstalledPackages();
  return packages;
}

0.2.0 #

  • Add getUserInstalledPackages()

0.1.1 #

  • change appIcon to getAppIcon() with basic parameters.

0.1.0_+1

  • add androidx and minSdkVersion caution.

0.1.0 #

  • add getInstalledPackages()

0.0.3 #

Add management of uninstalled apps

0.0.2 #

Add example

0.0.1 #

  • TODO: Describe initial release.

example/README.md

flutter_package_manager_example #

Demonstrates how to use the flutter_package_manager plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_package_manager: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_package_manager/flutter_package_manager.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Dec 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/flutter_package_manager.dart. (-1 points)

Analysis of lib/flutter_package_manager.dart reported 2 hints:

line 2 col 8: Unused import: 'dart:convert'.

line 4 col 8: Unused import: 'package:flutter/material.dart'.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test