Welcome to Dartantic Chat!

The dartantic_chat package provides Flutter chat UI widgets that make it easy to add an AI chat window to your app. Out of the box, it supports dartantic_ai for access to multiple LLM providers including Google Gemini, OpenAI, Anthropic, Mistral, and Ollama.

Screenshot

Key Features

  • Multi-turn chat - Maintains context across interactions
  • Streaming responses - Real-time AI response display
  • Voice input - Speech-to-text prompt entry
  • Multimedia attachments - Images, files, and URLs
  • Custom styling - Match your app's design
  • Chat serialization - Save and restore conversations
  • Custom response widgets - Specialized UI for responses
  • Pluggable LLM support - Easy provider integration
  • Cross-platform - Android, iOS, web, macOS, Linux, Windows
  • Function calling - Tool support via dartantic_ai

Quick Start

import 'package:dartantic_ai/dartantic_ai.dart';
import 'package:dartantic_chat/dartantic_chat.dart';

const _apiKey = String.fromEnvironment('GEMINI_API_KEY');

void main() {
  Agent.environment['GEMINI_API_KEY'] = _apiKey;
  runApp(const App());
}

class ChatPage extends StatelessWidget {
  const ChatPage({super.key});

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: const Text('Chat')),
    body: AgentChatView(
      provider: DartanticProvider(
        agent: Agent('gemini'),
      ),
    ),
  );
}

Run with your API key:

flutter run --dart-define=GEMINI_API_KEY=your-api-key-here

Documentation

Read the full documentation at docs.dartantic.ai

Contributing & Community

Contributions welcome! Feature requests, bug reports, and PRs are welcome on GitHub.

Want to chat about Dartantic? Drop by the Discussions forum.

License

This project is a fork of flutter/ai, licensed under the BSD 3-Clause License. See the LICENSE file for details.

Libraries

dartantic_chat
A library for integrating AI-powered chat functionality into Flutter applications.