Skip to content

Flutter AI writing assistant like Grammarly made with Gemini AI.

License

Notifications You must be signed in to change notification settings

lyabs243/flutter_ai_writing_assistant

Repository files navigation

Flutter AI Writing Assistant

An AI writing assistant like Grammarly using the Gemini AI API. It gets the text from the user and sends it to the Gemini AI API to:

  • Fix grammar mistakes
  • Display the reason for the correction
  • Specify the language of correction
  • Suggest alternative sentence if needed

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
  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"] in the first configuration object.
  6. Save the file.

Your file should look like this:

VS Code launch.json

Tests

You can run the tests using the following command:

flutter test --name="Test check method" test/assistant_test.dart --dart-define=API_KEY=YOUR_API_KEY --dart-define=SENTENCE="YOUR_TEXT"

Replace YOUR_API_KEY with your API key and YOUR_TEXT with the text you want to test.

Tests

App Demo

Text-only input

Tutorial

To learn more about this project, check out these links:

Explanation overview

AI Writing assistant app with Flutter and Gemini

About

Flutter AI writing assistant like Grammarly made with Gemini AI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published