Skip to content

Installation

Amayyas edited this page Jul 6, 2026 · 2 revisions

Installation

This guide will help you install Flutter AI SDK in your project.

Requirements

  • Dart SDK: >=3.0.0 <4.0.0
  • Flutter: >=3.10.0

Installing via pubspec.yaml

Add the following to your pubspec.yaml:

dependencies:
  flutter_ai_sdk: ^1.0.0

Then run:

flutter pub get

Installing via Command Line

Run the following command in your project directory:

flutter pub add flutter_ai_sdk

Dependencies

Flutter AI SDK uses the following packages (automatically installed):

Package Version Purpose
http ^1.1.0 HTTP client
dio ^5.4.0 Advanced HTTP features
equatable ^2.0.5 Value equality
uuid ^4.2.1 Unique ID generation
rxdart ^0.27.7 Reactive extensions
logger ^2.0.2 Logging utilities
retry ^3.1.2 Retry logic

Importing

After installation, import the library:

import 'package:flutter_ai_sdk/flutter_ai_sdk.dart';

This single import provides access to all SDK components:

  • FlutterAI - Main SDK class
  • AIConfig - Configuration options
  • AIProvider - Provider types enum
  • Content classes (TextContent, ImageContent, etc.)
  • Error classes (AIError, AIAuthenticationError, etc.)
  • Tool/Function calling classes

Platform Support

Platform Support
Android
iOS
Web
macOS
Windows
Linux

API Keys

You'll need API keys from the providers you want to use:

Provider Get API Key
OpenAI platform.openai.com
Anthropic console.anthropic.com
Google AI aistudio.google.com

⚠️ Security Note: Never commit API keys to version control. Use environment variables or secure storage.

Verifying Installation

Create a simple test to verify the installation:

import 'package:flutter_ai_sdk/flutter_ai_sdk.dart';

void main() {
  // If this compiles, the SDK is installed correctly
  final config = AIConfig(
    apiKey: 'test-key',
    model: 'gpt-5.5',
  );
  
  print('Flutter AI SDK installed successfully!');
  print('AIProvider values: ${AIProvider.values}');
}

Next Steps

Clone this wiki locally