Flutter: disable screenshot capture for app

后端 未结 6 1022
日久生厌
日久生厌 2020-12-14 10:48

I am making a Flutter app and I need to make sure the user is not able to capture screenshot of the app (any screen). Is there any way to achieve this in Flutter or do I nee

6条回答
  •  情书的邮戳
    2020-12-14 11:41

    If you are using kotlin

    open MainActivity.kt

    Add below code at end of imports

    import android.view.WindowManager.LayoutParams
    

    Add below code at end of super.onCreate(savedInstanceState)

    window.addFlags(LayoutParams.FLAG_SECURE)
    

    Its done.

提交回复
热议问题