native_opencv_kit 1.0.1 copy "native_opencv_kit: ^1.0.1" to clipboard
native_opencv_kit: ^1.0.1 copied to clipboard

A Flutter FFI plugin that wraps OpenCV for Android and iOS. Provides real-time blur detection and ID-card cropping using native C++ via dart:ffi.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:native_opencv/native_opencv.dart';
import 'package:native_opencv_example/camera_capture.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String platformVersion;
    try {
      platformVersion = NativeOpencv.getOpenCVVersion();
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        // Builder gives us a context that sits BELOW MaterialApp,
        // so Navigator.of(context) inside it can find the Navigator.
        body: Builder(
          builder: (context) {
            return Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('Running on: $_platformVersion\n'),
                  ElevatedButton(
                    onPressed: () {
                      Navigator.of(context).push(
                        MaterialPageRoute(
                          builder: (_) => const CameraCaptureScreen(),
                        ),
                      );
                    },
                    child: const Text('Open Camera Test'),
                  ),
                ],
              ),
            );
          },
        ),
      ),
    );
  }
}
0
likes
130
points
122
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter FFI plugin that wraps OpenCV for Android and iOS. Provides real-time blur detection and ID-card cropping using native C++ via dart:ffi.

Repository (GitHub)
View/report issues

Topics

#opencv #image-processing #ffi #blur-detection #id-card

License

MIT (license)

Dependencies

camera, ffi, flutter, http, plugin_platform_interface

More

Packages that depend on native_opencv_kit

Packages that implement native_opencv_kit