lock_unlock_device 0.0.1 copy "lock_unlock_device: ^0.0.1" to clipboard
lock_unlock_device: ^0.0.1 copied to clipboard

A new Flutter plugin.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter/services.dart';
import 'package:lock_unlock_device/lock_unlock_device.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Lock Device'),
        ),
        body: Center(
          child: FlatButton(
            color: Colors.red,
            textColor: Colors.white,
            onPressed: (){
              // Platform messages may fail, so we use a try/catch PlatformException.
              try {
               LockUnlockDevice.lockDevice();
              } on PlatformException {
                throw("PlatformException is raised");
              }
            },
            child: Text('Lock device'),
          ),
        ),
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on lock_unlock_device