skip to Main Content

I want code for flutter app in which there will be one button in that app ‘Destroy’ and when i click on that button that app should be deleted from device with data and cache so I need code for such implentation.

Expected get full code with successfull implemntaion.

2

Answers


  1. Chosen as BEST ANSWER

    I got answer of my own question here is how we can kill/uninstall app programitaclly in single click in flutter 1.add package : android_intent_plus: ^4.0.3 url_launcher: ^6.2.1

    2. add this in permission in androidmanfiestfile

    code:

    if (confirmUninstall == true) {
      final packageName =
          'add your own package here'; // Replace with your app's package name
      final intent = AndroidIntent(
        action: 'android.intent.action.DELETE',
        data: 'package:$packageName',
        package: packageName,
        flags: <int>[Flag.FLAG_ACTIVITY_NEW_TASK],
      );
      await intent.launch();
    }
    

  2. You can refer this library

    await DefaultCacheManager().emptyCache();
    

    You cannot delete OR remove an app with the click of a button within the app.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search