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

outdated

A Flutter plugin for manipulating Android WindowManager LayoutParams.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

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

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

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

class _MyAppState extends State<MyApp> {
  bool _secureMode = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text('Secure Mode: ${_secureMode.toString()}\n'),
              RaisedButton(
                onPressed: () async {
                  final secureModeToggle = !_secureMode;

                  if (secureModeToggle == true) {
                    await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);
                  } else {
                    await FlutterWindowManager.clearFlags(FlutterWindowManager.FLAG_SECURE);
                  }

                  setState(() {
                    _secureMode = !_secureMode;
                  });
                },
                child: const Text("Toggle Secure Mode")
              ),
            ],
          ),
        ),
      ),
    );
  }
}
337
likes
0
pub points
98%
popularity

Publisher

verified publisheradaptant.io

A Flutter plugin for manipulating Android WindowManager LayoutParams.

Repository
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_windowmanager