system_shortcuts 0.0.7

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

system_shortcuts

A flutter plugin to use system shortcuts.No IOS Implementation yet . Pull Request for ios implementation are welcome.

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

Functions

Press home button using this function.

await SystemShortcuts.home();// go to default laucher from any app

Press back button using this function

await SystemShortcuts.back();// perform a back button tap in android

Press volume Down in using this function

await SystemShortcuts.volDown();// perform a volume down button click

Press volume Down in using this function

await SystemShortcuts.volUp();// perform a volume up button click

Toggle WIFI using this function

await SystemShortcuts.wifi();// toggle wifi in android

Toggle BLUETOOTH using this function

await SystemShortcuts.bluetooth();// toggle bluetooth in android

Getters

Get current WIFI state

await SystemShortcuts.checkWifi;// return true/false

Get current BLUETOOTH state

await SystemShortcuts.checkBluetooth;// return true/false

Usage

FlatButton(
  child: Text("Home"),
  onPressed: () async {
    await SystemShortcuts.home();
  },
),
FlatButton(
  child: Text("Check Wifi"),
  onPressed: () async {
    bool wifi = await SystemShortcuts.checkWifi;
  },
),

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

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

0.0.7

Added async library to system_shortcuts.dart file.

0.0.6

Added license.

0.0.5

Updated dart doc documentation in system_shortcuts.dart file

0.0.4

Updated description

0.0.3

Example readme update

0.0.2

Removed the deprecated airplane mode error

0.0.1

Press home, back , volume up, volume Down buttons via flutter app and control your apps orientation(Portrait and Landscape).

example/README.md

FlatButton(
    child: Text("Home"),
    onPressed: () async {
    await SystemShortcuts.home();
    },
),
FlatButton(
    child: Text("Back"),
    onPressed: () async {
    await SystemShortcuts.back();
    },
),
FlatButton(
    child: Text("VolDown"),
    onPressed: () async {
    await SystemShortcuts.volDown();
    },
),
FlatButton(
    child: Text("VolUp"),
    onPressed: () async {
    await SystemShortcuts.volUp();
    },
),
FlatButton(
    child: Text("Landscape"),
    onPressed: () async {
    await SystemShortcuts.orientLandscape();
    },
),
FlatButton(
    child: Text("Portrait"),
    onPressed: () async {
    await SystemShortcuts.orientPortrait();
    },
),
FlatButton(
    child: Text("Wifi"),
    onPressed: () async {
    await SystemShortcuts.wifi();
    },
),
FlatButton(
    child: Text("Check Wifi"),
    onPressed: () async {
    print(await SystemShortcuts.checkWifi);
    },
),
FlatButton(
    child: Text("Bluetooth"),
    onPressed: () async {
    await SystemShortcuts.bluetooth();
    },
),
FlatButton(
    child: Text("Check Bluetooth"),
    onPressed: () async {
    print(await SystemShortcuts.checkBluetooth);
    },
),

Use this package as a library

1. Depend on it

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


dependencies:
  system_shortcuts: ^0.0.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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:system_shortcuts/system_shortcuts.dart';
  
Version Uploaded Documentation Archive
0.0.7 Jan 18, 2019 Go to the documentation of system_shortcuts 0.0.7 Download system_shortcuts 0.0.7 archive
0.0.6 Dec 15, 2018 Go to the documentation of system_shortcuts 0.0.6 Download system_shortcuts 0.0.6 archive
0.0.5 Dec 14, 2018 Go to the documentation of system_shortcuts 0.0.5 Download system_shortcuts 0.0.5 archive
0.0.4 Dec 12, 2018 Go to the documentation of system_shortcuts 0.0.4 Download system_shortcuts 0.0.4 archive
0.0.2 Dec 12, 2018 Go to the documentation of system_shortcuts 0.0.2 Download system_shortcuts 0.0.2 archive
0.0.1 Dec 10, 2018 Go to the documentation of system_shortcuts 0.0.1 Download system_shortcuts 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/system_shortcuts.dart.

Run flutter format to format lib/system_shortcuts.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8