Flutter: disable screenshot capture for app

  1. Locate your MainActivity class inside the embedded android project dir in your Flutter Project
  2. Add the following import to your main activity class: import android.view.WindowManager.LayoutParams;
  3. Add the following line to your MainActivity’s onCreate method: getWindow().addFlags(LayoutParams.FLAG_SECURE);

Leave a Comment