flutter_ocr_sdk 1.2.0 flutter_ocr_sdk: ^1.2.0 copied to clipboard
A wrapper for Dynamsoft OCR SDK, detecting MRZ in passports, travel documents, and ID cards.
import 'package:flutter/material.dart';
import 'tab_page.dart';
import 'dart:async';
import 'global.dart';
Future<void> main() async {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
Future<int> loadData() async {
return await initMRZSDK();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Dynamsoft MRZ Detection',
theme: ThemeData(
scaffoldBackgroundColor: colorMainTheme,
),
home: FutureBuilder<int>(
future: loadData(),
builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
if (!snapshot.hasData) {
return const CircularProgressIndicator(); // Loading indicator
}
Future.microtask(() {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => const TabPage()));
});
return Container();
},
),
);
}
}