This is a demo Flutter application developed to showcase the integration of the Gemini AI model into a Flutter app for cross-platform solutions.
It is for a presentation made at GDGLafia IO Extended 2024 Event.
The slide presented at the event can be accessed via Clicking Here
- Flutter SDK
- Dart SDK
- A valid API key for the Gemini AI model
-
Clone the repository:
git clone https://github.com/yourusername/flutter-gemini-demo.git cd flutter-gemini-demo
-
Install dependencies:
flutter pub get
-
Configure API Key:
- Open
lib/pages/chat_page.dart
. - Replace the
_geminiAPIKey
with your Gemini API key.
- Open
- Run on an emulator or connected device:
flutter run
- Launch the app on your device.
- Interact with the AI-powered chat by typing messages into the text field at the bottom of the screen and pressing the send button.
- Observe AI responses generated by the Gemini model.
lib/main.dart
: Entry point of the application.lib/pages/chat_page.dart
: Main chat page with AI integration.lib/model/chat.dart
: Data model for chat messages.
flutter/material.dart
: Flutter framework.google_generative_ai
: Package for interacting with the Gemini AI model.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This application was built without taking into considerations good coding practices
In an actual
- API key should be store in a secrets store or as environment variable
- Separation of concern of various part of the app (i.e everything shouldn't be cramped into one file)