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

Flutter plugin that allows you to detect iOS screen capture.

example/lib/main.dart

import 'package:capture_detector/capture_detector.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class _MyAppState extends State<MyApp> {
  bool? _isCaptured;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              StreamBuilder(
                stream: CaptureDetector.isCapturedStream,
                builder: (context, snapshot) {
                  return Text('stream: ${snapshot.data}\n');
                },
              ),
              Text("future : $_isCaptured"),
              TextButton(
                style: ButtonStyle(
                    backgroundColor: MaterialStateColor.resolveWith(
                        (states) => Colors.black.withOpacity(0.1))),
                onPressed: () async {
                  _isCaptured = await CaptureDetector.getIsCaptured;
                  setState(() {});
                },
                child: const Text("get IsCaptured"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin that allows you to detect iOS screen capture.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on capture_detector

Packages that implement capture_detector