Search packages, repositories and app categories

Package detailsv2.2.1

google_vision

Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
306
Likes
46
Pub points
160

Install package

flutter pub add google_vision

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The google_vision package enables cross-platform Flutter applications to leverage Google Cloud Vision API for advanced image analysis. It supports image labeling, face and landmark detection, logo recognition, optical character recognition (OCR), and identification of explicit content. By integrating seamlessly with Android, iOS, Web, macOS, Windows, and Linux, it empowers developers to build intelligent apps that understand visual content. The package simplifies access to powerful machine learning models through a straightforward Dart interface.

Use cases

  • Image content moderation
  • Automated document scanning
  • Visual search features
  • User-generated content analysis
  • Face and object recognition in apps
  • Brand logo detection

Key features

  • Supports OCR with text extraction
  • Detects faces, landmarks, and logos
  • Identifies explicit or sensitive content
  • Cross-platform compatibility
  • Simple API integration
  • Real-time image analysis

Suitable for

  • Apps needing image understanding
  • Developers building AI-powered tools
  • Content platforms requiring moderation
  • Document processing applications
  • Mobile and web apps with visual features

Considerations

  • Requires Google Cloud API key
  • May incur usage costs
  • Depends on internet connectivity
  • Limited offline capabilities
  • Rate limits apply
  • Privacy considerations for image data

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Google Vision Workspace

Melos-managed Dart/Flutter monorepo for the Google Vision API.

pub package pub package

Packages

Package Description Pub
google_vision Core Dart REST client for image annotation, OCR, and document analysis pub
google_vision_cli CLI tool for running Vision API requests from the terminal pub
google_vision_flutter Flutter widget wrapping the core library pub

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
# Install via Homebrew
brew tap cdavis-code/google-vision
brew install vision

# Run landmark detection
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

Categories

Dependencies

Dependency list 12 items

Source repository

Projects using this package

No data available yet.