flutter_lock_task 0.0.2 copy "flutter_lock_task: ^0.0.2" to clipboard
flutter_lock_task: ^0.0.2 copied to clipboard

PlatformAndroid

Kiosk Mode for Device Lockdown.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_lock_task/flutter_lock_task.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(children: [
            ElevatedButton(
              child: const Text('startLockTask'),
              onPressed: () { 
                FlutterLockTask().startLockTask().then((value) {
                  print("startLockTask: " + value.toString());
                });
              }
            ),
            ElevatedButton(
              child: const Text('stopLockTask'),
              onPressed: () { 
                FlutterLockTask().stopLockTask().then((value) {
                  print("stopLockTask: " + value.toString());
                });
              }
            ),
            ElevatedButton(
              child: const Text('isInLockTaskMode'),
              onPressed: () { 
                FlutterLockTask().isInLockTaskMode().then((value) {
                  print("isInLockTaskMode: " + value.toString());
                });
              }
            ),
            ElevatedButton(
              child: const Text('setDeviceOwnerApp (only root device)'),
              onPressed: () { 
                FlutterLockTask().setDeviceOwnerApp().then((value) {
                  print("setDeviceOwnerApp: " + value.toString());
                });
              }
            ),
            ElevatedButton(
              child: const Text('clearDeviceOwnerApp'),
              onPressed: () { 
                FlutterLockTask().clearDeviceOwnerApp().then((value) {
                  print("clearDeviceOwnerApp: " + value.toString());
                });
              }
            ),
            ElevatedButton(
              child: const Text('openHomeSettings'),
              onPressed: () { 
                FlutterLockTask().openHomeSettings().then((value) {
                  print(value);
                });
              }
            ),
            ElevatedButton(
              child: const Text('getPackageName'),
              onPressed: () { 
                FlutterLockTask().getPackageName().then((value) {
                  print(value);
                });
              }
            )
          ]),
        ),
      ),
    );
  }
}
6
likes
130
points
119
downloads

Publisher

unverified uploader

Weekly Downloads

Kiosk Mode for Device Lockdown.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_lock_task