app_uninstaller 0.4.1 copy "app_uninstaller: ^0.4.1" to clipboard
app_uninstaller: ^0.4.1 copied to clipboard

Flutter plugin to uninstall android apps.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:app_uninstaller/app_uninstaller.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  String uninstallStatus = "";

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                FlatButton(
                  textColor: Colors.white,
                  color: Colors.pink,
                  onPressed: () async {
                    try {
                      var isUninstalled = await AppUninstaller.Uninstall(
                          "com.example.testapplication");
                      setState(() {
                        uninstallStatus = isUninstalled
                            ? "Successfully Uninstalled!"
                            : "Cancelled by user";
                      });
                    } on Exception {
                      uninstallStatus = "Some error occurred";
                    }
                  },
                  child: Text(
                    "Uninstall Test Application",
                    style: TextStyle(fontSize: 18),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  uninstallStatus,
                  style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
                )
              ]),
        ),
      ),
    );
  }
}
11
likes
20
pub points
43%
popularity

Publisher

unverified uploader

Flutter plugin to uninstall android apps.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on app_uninstaller