Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plant Identifier

A Flutter app that identifies plants from photos on your device. You pick an image from the camera or gallery, send it to Google Gemini (vision), and get a common name, scientific name, short description, and care hints for water, sunlight, and soil.


Features

  • On-device capture — Camera or photo library via image_picker.
  • AI identification — Multimodal prompt with google_generative_ai (gemini-2.5-flash).
  • Structured results — Parsed JSON with plant metadata and a simple care guide UI (Material 3).
  • Non-plant handling — The model can respond with is_plant: false when the image is not a plant.

Requirements


Quick start

git clone <your-repo-url>
cd plant_identifier
flutter pub get

API key (required)

The app reads the key from compile-time defines (AppConfig uses String.fromEnvironment('GEMINI_API_KEY', ...)).

Recommended: pass the key when you run or build — it stays out of source control:

flutter run --dart-define=GEMINI_API_KEY=YOUR_KEY_HERE

Release builds:

flutter build apk --dart-define=GEMINI_API_KEY=YOUR_KEY_HERE
flutter build ios --dart-define=GEMINI_API_KEY=YOUR_KEY_HERE

If GEMINI_API_KEY is empty at runtime, identification will fail with a clear error.

Security: Do not commit real API keys. Prefer --dart-define, CI secrets, or a local untracked config — never push keys to a public repository.


Project structure

Path Role
lib/main.dart App entry, wires repository + home page
lib/core/config/app_config.dart GEMINI_API_KEY from environment
lib/domain/ Entities, repository contract, failures
lib/data/ Gemini remote data source, repository implementation
lib/presentation/ Page, controller, widgets

This follows a small clean architecture split so you can swap the AI backend or add local caching without rewriting the UI.


Platform notes

Android (AndroidManifest.xml): camera and media read permissions are declared for capture and gallery.

iOS (Info.plist): NSCameraUsageDescription and NSPhotoLibraryUsageDescription are set for App Store compliance.


Disclaimer

Identifications are best-effort from a generative model. They may be wrong or incomplete. Use for curiosity and gardening hints, not as the sole basis for toxicity, foraging, or medical decisions.


Useful links

About

🌿 AI-powered plant identifier built with Flutter & Google Gemini API | Clean Architecture | Camera & Image Recognition

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages