A flutter plugin to query Android device Administrator (DevicePolicyManager) particulary Locking screen

Overview

device_policy_manager

A flutter plugin to query Android device Administrator (DevicePolicyManager) particulary Locking screen

for more info check DevicePolicyManager

Installation and usage

Add package to your pubspec:

dependencies:
  device_policy_manager: any # or the latest version on Pub

Inside AndroidManifest add this to bind deviceAdmin receiver with your application

">
    ...
  
      
      
          
          
          
      
  



Create policies.xml inside res/xml and add the following code inside it:

">


    
        
    


USAGE

/// Return `true` if the given administrator component is currently active (enabled) in the system.
final status = await DevicePolicyManager.isPermissionGranted();

/// request administrator permission
/// it will open the adminstartor permission page and return `true` once the permission granted.
/// An optional message providing additional explanation for why the admin is being added.
await DevicePolicyManager.requestPermession("Your app is requesting the Adminstration permission");

/// Remove administration permission from the current app.
await DevicePolicyManager.removeActiveAdmin();

/// Make the device lock immediately, as if the lock screen timeout has expired at the point of this call.
/// After this method is called, the device must be unlocked using strong authentication (PIN, pattern, or password).
await DevicePolicyManager.lockNow();

/// Determine whether or not the device's cameras have been disabled for this user.
final status = await DevicePolicyManager.isCameraDisabled();
You might also like...

A Flutter plugin for Android and iOS allowing access to the device cameras, a bit deeper!!

flutter_cameraview A Flutter plugin for Android and iOS allowing access to the device cameras, a bit deeper!!. This plugin was created to offer more a

Oct 22, 2022

Resource monitor - A flutter plugin for Android and IOS to monitor CPU and RAM usage of device.

resource_monitor A flutter plugin for Android and IOS to monitor CPU and RAM usage of device. TODO Return overall system cpu/memory usage. Implement A

Nov 11, 2022

A Flutter plugin for iOS and Android allowing access to the device cameras.

A Flutter plugin for iOS and Android allowing access to the device cameras.

Jan 8, 2023

Snooper android - Flutter platform package for Android which provides concrete implementations for various device info lookups

Snooper android - Flutter platform package for Android which provides concrete implementations for various device info lookups

Flutter platform package for Android which provides concrete implementations for

Jan 27, 2022

Flutter onboarding screen - An example of onboarding screen on Flutter

Flutter onboarding screen - An example of onboarding screen on Flutter

Flutter Onboarding Screen IntroViews is inspired by Paper Onboarding. Thanks to Fluttery. Future Development Pull requests and suggestions welcome. Lo

Aug 3, 2022

Flutter screen adaptation, font adaptation, get screen information

Flutter screen adaptation, font adaptation, get screen information

flutter_screenutil A flutter plugin for adapting screen and font size.Let your UI display a reasonable layout on different screen sizes! Note: This pl

Jan 6, 2023

Flutter-Shared-Preference - The goal is to learn how to use the shared preferences plugin to save important pieces of information to your device.

Flutter-Shared-Preference - The goal is to learn how to use the shared preferences plugin to save important pieces of information to your device.

Recipe Finder The goal is to learn how to use the shared preferences plugin to save important pieces of information to your device. Final App UI Resou

Jan 1, 2022

System info plus - A Flutter plugin to get device Random Access Memory (RAM) size

system_info_plus A Flutter plugin to get device Random Access Memory (RAM) size.

Aug 21, 2022

A flutter plugin for device vibration and haptic feedback.

Vibrate A Flutter plugin to vibrate the device. This uses all the current Haptic Feedback APIs from Apple and provides similar feedback on Android. Ge

Sep 27, 2022
Comments
  • Oppening the app when user locked screen

    Oppening the app when user locked screen

    Hi, I see that some applications need to open the app even when the app is locked. For example, Whatsapp when getting a call open the call screen even if it was locked. When I developed as an android developer I do something like that and open a specific screen. it needs the Administration's permission. is it possible that add open app() method to your plugin?

    opened by alirezat66 1
Owner
Iheb Briki
I'm a full-stack developer and mainly use Flutter, ReactJs, MeteorJs & .NET. trying to be better every day @PixeliumTN
Iheb Briki
GrowERP Flutter Administrator front-end & Hotel & Ecommerce for Android, IOS and Web using Moqui.org, Apache OFBiz

Welcome to flutter open source GrowERP. GrowERP is an open source multi platform ERP application you can try right now! We have latest test version at

GrowERP 11 Dec 24, 2022
Android test task master - Create PIN code screen, authentication by PIN code screen and menu screen

Here is described test tasks for a android dev. Need to implement three screens:

null 3 Oct 4, 2022
Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, and web.

Wakelock Wakelock is Flutter plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping. Supported platforms Platfo

null 341 Jan 4, 2023
Doctor Consultation App in Flutter containing splash screen on boarding screen Routing state management Dash board Bottom navigation Decorated Drawer and Doctors Screen in the last.

Online doctor Consultation App UI in Flutter Doctor Consultation App UI in Flutter Visit Website Features State Management Navigation Bar Responsive D

Habib ullah 14 Jan 1, 2023
A Flutter plugin to request the device unlock screen.

device_unlock A Flutter plugin to request the device unlock screen on Android and iOS. How does it work The following attempts and fallbacks are made:

Cíngulo 19 Sep 7, 2022
SSH no ports provides ssh to a remote Linux device with out that device having any ports open

Ssh! No ports ssh no ports provides a way to ssh to a remote linux host/device without that device having any open ports (not even 22) on external int

The Atsign Foundation 224 Dec 21, 2022
A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper on Android devices.

wallpaper_manager A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper(s) on Android devices. Usage Installation In the pubs

Aditya Mulgundkar 38 Nov 28, 2022
An online query App for COVID-19 statistics developed by Flutter was used.

如果产生其他依赖无法编译的问题,可以尝试将pubspec.yaml中的dependencies中的所有依赖的"^"去掉,重新编译尝试。 nCoV_2019 获取新肺炎实时动态App,支持Android和IOS。 Log 2020.09.03 - 适配Flutter 1.20 2020.07.04 -

FlutterCandies 261 Dec 11, 2022
Esizer - A Flutter package provide responsive, dynamic, configurable size for each device screen size

ESizer A Flutter package provide responsive, dynamic, configurable size for each

Extreme Vietnam Public 1 Feb 15, 2022
A Flutter plugin for iOS and Android allowing access to the device cameras.

Camera Plugin A Flutter plugin for iOS and Android allowing access to the device cameras. Note: This plugin is still under development, and some APIs

Rebar Ahmad 1 Mar 17, 2020