butler_labs 0.0.3 butler_labs: ^0.0.3 copied to clipboard
A Pure Dart SDK for Butler Labs OCR
Butler Labs OCR #
A Pure Dart SDK for Butler Labs OCR.
Supported Models #
✅ Passport
✅ Receipt
✅ Invoice
✅ ID Card
✅ W2
✅ W9
✅ Mortgage
✅ Paystub
Tables are not supported yet
Supported Endpoints #
✅ Get Enhanced Extraction Results
🔲 Update Labels for a Document
Usage #
See blog post for setup and usage instructions.
ElevatedButton(
onPressed: () async {
license.value = null;
ImagePicker picker = ImagePicker();
XFile? pickedImage = await picker.pickImage(source: ImageSource.gallery);
if (pickedImage == null) return;
Uint8List imageBytes = await pickedImage.readAsBytes();
// You can use the ButlerResult class
ButlerResult? output = await ButlerLabs(const String.fromEnvironment('BUTLER_API_KEY')).performOcrOnImageBytes(
imageBytes: imageBytes,
queueId: Model.driversLicense.id,
);
if (output != null) {
license.value = DriversLicense.fromButlerResult(output);
}
// Or you can use the map method
/*Map<String, dynamic>? output = await ButlerLabs(const String.fromEnvironment('BUTLER_API_KEY')).performOcrOnImage(
imageBytes: imageBytes,
queueId: Model.driversLicense.id,
);
if (output != null) {
license.value = DriversLicense.fromJson(output);
}*/
},
child: const Text('Upload Image'),
),