quickcapture 0.0.3
quickcapture: ^0.0.3 copied to clipboard
QuickCapture Mobile Scanning SDK Specially designed for flutter from Extrieve.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:quickcapture/quickcapture.dart';
void main() {
runApp(const MyApp());
}
typedef MyCallback = void Function(String result);
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _quickcapturePlugin = Quickcapture();
@override
void initState() {
super.initState();
// Set the method call handler
//initPlatformState();
}
void _showAlertDialog(BuildContext context, String response) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Captured file path for test'),
content: Text(response),
actions: [
TextButton(
onPressed: () {
// Close the dialog
Navigator.of(context).pop();
},
child: Text('OK'),
),
],
);
},
);
}
startCapture(context) async {
String response = "";
response = (await _quickcapturePlugin.startCapture())!;
_showAlertDialog(context, response);
if (!mounted) return;
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('QuickCapture sample'),
),
body: Center(
child: ElevatedButton(
onPressed: () => {startCapture(context)},
child: const Text("Done"),
),
),
),
);
}
}