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

PlatformAndroid

A simple package to check if an application has been uninstalled, returning a boolean value.

example/lib/main.dart

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

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    final bool success =
        await MyUninstallPlugin.uninstallApp("com.transsion.carlcare");

    if (success) {
      print("Uninstall success");
    } else {
      print("Uninstall failed");
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: TextButton(
            child: Text("Uninstall"),
            onPressed: () {
              initPlatformState();
            },
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
1
downloads

Publisher

verified publisheretalasedn.co.id

Weekly Downloads

A simple package to check if an application has been uninstalled, returning a boolean value.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on my_uninstall_plugin

Packages that implement my_uninstall_plugin