skip to Main Content

In My Application I want to show if the developer mode is on then show one screen for restriction of developer mode

My Application in Flutter

I try to get devoption value from the settings
int devOptions =Settings.Secure.getInt(this.getContentResolver(),Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);

2

Answers


  1. you can use below package :

    dependencies:
    flutter_jailbreak_detection: ^1.8.0

    and use like this (currently this works for android only):

    bool developerMode = await FlutterJailbreakDetection.developerMode;
    
    Login or Signup to reply.
  2. Here’s a quick solution to detect developer options in Flutter:

    Don’t forget: device_info_plus: ^9.1.0 in pubspec.yaml

    import 'package:device_info_plus/device_info_plus.dart';
    
    Future<bool> isDevMode() async {
      if (Platform.isAndroid) {
        AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
        return info.isPhysicalDevice ?? false;
      }
      return false;
    }
    
    // Usage
    if (await isDevMode()) {
      // Show restriction screen
    } else {
      // Show normal screen
    }
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search