Gemini Chat FAB

A Flutter package that adds a pre-built Floating Action Button to your app, launching a beautiful and fully functional chat interface powered by the Google Gemini API.

Features

  • βœ… Simple, one-line installation.
  • πŸ’¬ Streaming responses for a real-time feel.
  • 🎨 Adapts to your app's theme.
  • πŸš€ Lightweight and dependency-free.

Installation

Add this to your app's pubspec.yaml file:

dependencies:
  gemini_chat_fab: ^1.1.0 # Use the latest version

Usage

Simply place the GeminiChatFab widget in the floatingActionButton property of your Scaffold.

Make sure to provide your API key when running the app:

flutter run --dart-define=GEMINI_API_KEY=YOUR_KEY_HERE

Flow

Add this in your file.

geminiApiKey = String.fromEnvironment('GEMINI_API_KEY');

Then simply add

floatingActionButton: const GeminiChatFab(
  apiKey: geminiApiKey, 
  systemPrompt: "Enter whatever prompt to tailor your needs.",)

Libraries

gemini_chat_fab