Home > database >  How do I disable screen mirroring for Flutter app?
How do I disable screen mirroring for Flutter app?

Time:07-19

I'm working on a new flutter app and the client wants to detect screen mirroring and disable it, Is there is a way to do so in Flutter using a third party package or something?

I've tried using the FLAG_SECURE in android but it disables only screenshots not screen mirroring.

CodePudding user response:

There is no out of the box package for flutter. And there is also no effective way to disable mirroring for Android and iOS.

What you can do on Android is to use the DisplayManager to get all current logical displays with the method getDisplays. Then you can maybe show a pop up if the number of displays is to big for your app, in order to inform the user.

For iOS I don't think there is something available to stop or at least detect screen mirroring.

CodePudding user response:

for android side we can use

int CanMirror = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);

you can get better idea :https://stackoverflow.com/a/63971764/18340828

and ios side dont have much idea.

  • Related