Skip to content

lyabs243/test_gemini

Repository files navigation

Test Gemini

This is a test project using the Gemini AI with Flutter.

Installation

To use this project, you need to have the Flutter SDK installed. You can find the installation instructions.

To use the Gemini AI, you need to have an API key. Get an API Key.

To add your API key to the project, you have to add it to pass it to the flutter run command:

flutter run --dart-define=API_KEY=$YOUR_API_KEY

Replace $YOUR_API_KEY with your API key.

You can set your IDE's run configuration to pass the API key.

Android Studio

  1. Open the project in Android Studio.
  2. Click on the main.dart dropdown at the top of the window.
  3. Click on Edit Configurations....
  4. In the Additional run args field, add --dart-define=API_KEY=YOUR_API_KEY
  5. Click on Apply and OK.

Your configuration should look like this:

Android Studio run configuration

VS Code

  1. Open the project in VS Code.
  2. Click on Run and Debug from the left sidebar.
  3. Click on create a launch.json file.
  4. Select Dart & Flutter.
  5. Add "args": ["--dart-define=API_KEY=YOUR_API_KEY"] in the first configuration object.
  6. Save the file.

Your file should look like this:

VS Code launch.json

Use cases

Generate text from text-only input

Text-only input

Generate text from text-and-image input (multimodal)

Text-and-image input

Build multi-turn conversations (chat)

Chat

Use streaming for faster interactions

Streaming

Tutorial

To learn more about this project with in-depth explanations, check out these links:

Complete demo

To see the complete demo, check out this video:

Demo application using Gemini AI with Flutter and Dart

About

A Flutter test project for Gemini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published