google_vision
2.2.1, released 5 months ago by cdavis.ca
Integrates Google Vision REST API features for image analysis and OCR.
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.
- universal_io
Cross-platform dart:io implementation with browser support for HttpClient and other APIs
63Compare - simple_link_preview
Fetch lightweight link preview metadata from HTTP and HTTPS URLs.
50Compare
Works with
Packages commonly used together with google_vision: ones it builds on, ones built on it, and its own family.
- mimegoogle_vision depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- json_annotationgoogle_vision depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- imagegoogle_vision depends on itPure Dart library to load, manipulate, encode, and decode various image formats.
- diogoogle_vision depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- universal_platformgoogle_vision depends on itPlatform detection across Flutter, Dart web, and desktop without errors
- retrofitgoogle_vision depends on itDart Dio client generator using source_gen
- crypto_keysgoogle_vision depends on itLibrary for signing, verifying, encrypting and decrypting using pointycastle.
- josegoogle_vision depends on itJavascript Object Signing and Encryption library supporting JWE, JWS, JWK and JWT.