Google Vision Workspace
Melos-managed Dart/Flutter monorepo for the Google Vision API.
![pub package]()
Packages
Features
- Image Labeling — identify objects, locations, activities, and more
- Face Detection — detect faces and facial attributes (emotion, headwear, etc.)
- Logo Detection — recognize popular brand logos
- Landmark Detection — identify natural and man-made landmarks
- Optical Character Recognition (OCR) — extract text from images and documents
- Safe Search — detect explicit content across multiple categories
- Crop Hints — suggest optimal image crops
- Web Detection — find matching images and pages on the web
Quick Start
Dart (core library)
import 'package:google_vision/google_vision.dart';
final googleVision = await GoogleVision.withApiKey('YOUR_API_KEY');
final response = await googleVision.image.labelDetection(
jsonImage: JsonImage.fromPath('path/to/image.jpg'),
);
CLI
brew tap cdavis-code/google-vision
brew install vision
vision detect --image-file photo.jpg --features LANDMARK_DETECTION
Flutter
GoogleVisionFlutter(
apiKey: 'YOUR_API_KEY',
imagePath: 'assets/photo.jpg',
features: [FeatureType.labelDetection],
)
Authentication
The core library supports three auth strategies:
| Method |
Use Case |
withApiKey(key) |
Quick start, development |
withJwt(credentialsJson) |
Service accounts, production |
withGenerator(generator) |
Custom token refresh logic |
Workspace Commands
This project uses Melos for monorepo management.
| Action |
Command |
| Get dependencies |
melos run dep |
| Analyze |
melos run analyze |
| Format |
melos run format |
| Build (codegen) |
melos run build |
| Generate docs |
melos run doc |
| Pana score check |
melos run pana |
| Publish prep |
melos run prep |
CI / CD
GitHub Actions workflows run on every push:
License
MIT