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

outdated

MNC Flutter plugin KTP scanner for iOS and Android.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:mnc_identifier_ocr/mnc_identifier_ocr.dart';
import 'package:mnc_identifier_ocr/model/ocr_result_model.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> {
  OcrResultModel? result;

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> scanKtp() async {
    OcrResultModel? res;
    try {
      res = await MncIdentifierOcr.startCaptureKtp(withFlash: true);
    } catch (e) {
      debugPrint('something goes wrong $e');
    }

    if (!mounted) return;

    setState(() {
      result = res;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Stack(
          children: [
            Text('Ktp data: ${result?.toJson()}'),
            Center(
                child: ElevatedButton(
                    onPressed: scanKtp, child: const Text('PUSH HERE')))
          ],
        ),
      ),
    );
  }
}
28
likes
0
points
98
downloads

Publisher

verified publishermobile.mncinnovation.id

Weekly Downloads

MNC Flutter plugin KTP scanner for iOS and Android.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on mnc_identifier_ocr