pkb_no_screenshots

Last updated:

0 purchases

pkb_no_screenshots Image
pkb_no_screenshots Images
Add to Cart

Description:

pkb no screenshots

PKB No Screenshots #
Flutter plugin to enable, disable or toggle screenshot support in your application. ios and android.
copied to clipboard
Usage #
const Text(
'ScreenshotIOS',
),
ElevatedButton(
onPressed: () {
DisableScreenshots.disable_enable('');
},
child: Text('Disabled'),
),

const Text(
'ScreenshotAndroid',
),
ElevatedButton(
child: const Text('Press to turn off screenshot'),
onPressed: () {
DisableScreenshots.disable_enable('D');
},
),
ElevatedButton(
child: const Text('Press to turn on screenshot'),
onPressed: () {
DisableScreenshots.disable_enable('E');
},
),
copied to clipboard
Add native ios #
Add code to your ios/Runner/AppDelegate.swift dependencies
copied to clipboard
Usage #
import UIKit
import Flutter

let CHANNEL = "disableScreenshots"
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let controller: FlutterViewController = window?.rootViewController as! FlutterViewController
let channel = FlutterMethodChannel(name: CHANNEL, binaryMessenger: controller.binaryMessenger)
channel.setMethodCallHandler({
[weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in
if (call.method == "disable") {
self?.window?.makeSecureDisable()
}
})
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}

extension UIWindow {
func makeSecureDisable() {
let field = UITextField()
let view = UIView(frame: CGRect(x: 0, y: 0, width: field.frame.self.width, height: field.frame.self.height))
field.isSecureTextEntry = true
self.addSubview(field)
self.layer.superlayer?.addSublayer(field.layer)
field.layer.sublayers?.last!.addSublayer(self.layer)
field.leftView = view
field.leftViewMode = .always
}
}

copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.