system_shortcuts 0.0.2 copy "system_shortcuts: ^0.0.2" to clipboard
system_shortcuts: ^0.0.2 copied to clipboard

outdated

A flutter plugin to use system shortcuts

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: ListView(
          children: <Widget>[
            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);
              },
            ),
          ],
        )),
      ),
    );
  }
}
35
likes
0
pub points
64%
popularity

Publisher

unverified uploader

A flutter plugin to use system shortcuts

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on system_shortcuts