fshell_android 0.9.0 copy "fshell_android: ^0.9.0" to clipboard
fshell_android: ^0.9.0 copied to clipboard

The first way to execute shell commands in Flutter !

example/lib/main.dart

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

import 'package:fshell_android/fshell_android.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: Column(
            children: <Widget>[
              // This is just a test for SOME commands
              new MaterialButton(
                  onPressed: () async {
                    String result = await FShellAndroid.echo(1.toString());
                    print(result);
                  },
                  child: new Text('Echo 1'),
              ),
              new MaterialButton(
                onPressed: () async {
                  String result = await FShellAndroid.executeCommand("whoami");
                  print(result);
                },
                child: new Text('Whoami'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

The first way to execute shell commands in Flutter !

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on fshell_android