twrpbuilder_plugin 1.0.1 copy "twrpbuilder_plugin: ^1.0.1" to clipboard
twrpbuilder_plugin: ^1.0.1 copied to clipboard

discontinued
outdated

A new Flutter plugin for TwrpBuilder App. With this library you can request root access and also execute Shell commands

example/lib/main.dart

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

import 'package:twrpbuilder_plugin/twrpbuilder_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {
  bool _rootAccess = false;
  String dirStatus = "";

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

  Future<void> initRootRequest() async {
    bool rootAccess = await TwrpbuilderPlugin.rootAccess;

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _rootAccess = rootAccess;
    });

    if(_rootAccess){
      dirStatus = await TwrpbuilderPlugin.mkDir('TWRPBU'); //TWRPBU is the name of the directory to be created
      print(dirStatus);
    }
  }



  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: Column(
            children: <Widget>[
              Text('Root status: $_rootAccess'),
              Text('Directory status: $dirStatus')
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisheramitkhairnar.dev

A new Flutter plugin for TwrpBuilder App. With this library you can request root access and also execute Shell commands

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on twrpbuilder_plugin