Skip to content
pubscout

google_vision

2.2.1, released 5 months ago by cdavis.ca

Integrates Google Vision REST API features for image analysis and OCR.

WASM-ready
$ flutter pub add google_vision
Source repository

What it does

Allows developers to add Google Vision features including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and explicit content detection into cross-platform applications.

AI-written summary of version 2.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to integrate Google Cloud Vision API features into a Dart or Flutter application.
  • You want built-in support for OCR, document text to markdown conversion, and face or label detection.

Skip it when

  • You require on-device machine learning models that do not depend on cloud connectivity or API keys.
  • You are looking for general image picking or cropping tools without cloud analysis.

Strengths

  • Comprehensive coverage of Google Vision REST API features.
  • Includes retry utilities, input validation, and secure logging interceptors.
  • Supports multiple authentication methods including JWT and API keys.

Weaknesses

  • Requires an active internet connection and a Google Cloud account with Vision API enabled.
  • May involve ongoing costs depending on Google Cloud Vision API usage pricing.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
12

Requires obtaining a Google Cloud project, enabling the Cloud Vision API, and configuring an API key or service account JSON file.

final googleVision = await GoogleVision().withApiKey('[YOUR API KEY]');

final faceAnnotationResponses = await googleVision.image.faceDetection(
    JsonImage.fromGsUri('gs://gvision-demo/young-man-smiling-and-thumbs-up.jpg'));

for (var faceAnnotation in faceAnnotationResponses) {
  print('Face - ${faceAnnotation.detectionConfidence}');
}

Alternatives

Packages that do the same job and could replace google_vision.

Works with

Packages commonly used together with google_vision: ones it builds on, ones built on it, and its own family.