flutter_exit_windows_ex 0.1.0 copy "flutter_exit_windows_ex: ^0.1.0" to clipboard
flutter_exit_windows_ex: ^0.1.0 copied to clipboard

Logs off the interactive user, shuts down the system

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_exit_windows_ex/flutter_exit_windows_ex.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('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              RaisedButton(
                onPressed: () async {
                  print(await FlutterExitWindowsEx.exitWindowsEx(EWX_SHUTDOWN));
                },
                child: Text("关机 Shutdown"),
              ),
              RaisedButton(
                onPressed: () async {
                  print(await FlutterExitWindowsEx.exitWindowsEx(EWX_LOGOFF));
                },
                child: Text("注销 Logoff"),
              ),
              RaisedButton(
                onPressed: () async {
                  print(await FlutterExitWindowsEx.exitWindowsEx(EWX_REBOOT));
                },
                child: Text("重启 Reboot"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

verified publisherajanuw.lol

Logs off the interactive user, shuts down the system

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_exit_windows_ex