butler_labs 0.0.3 copy "butler_labs: ^0.0.3" to clipboard
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 #

US Driver's License

Passport

Receipt

Invoice

ID Card

W2

W9

Mortgage

Health Insurance Card

Paystub

Tables are not supported yet

Supported Endpoints #

Extract Document

Get Enhanced Extraction Results

🔲 Upload Documents

🔲 Get Extraction Results

🔲 Delete Upload

🔲 Create Model

🔲 Get Model Info

🔲 Train Model

🔲 Update Labels for a Document

🔲 Get Bank Statement Results

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'),
),
1
likes
140
pub points
14%
popularity

Publisher

verified publishercodeontherocks.dev

A Pure Dart SDK for Butler Labs OCR

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

collection, flutter, http, http_parser, json_annotation

More

Packages that depend on butler_labs