dartantic_chat 0.1.0 copy "dartantic_chat: ^0.1.0" to clipboard
dartantic_chat: ^0.1.0 copied to clipboard

AI chat widget for Flutter apps targeting mobile, desktop, and web supporting text, image, and voice input.

example/lib/main.dart

// Copyright 2024 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

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

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

void main() {
  assert(_apiKey.isNotEmpty, 'GEMINI_API_KEY not provided via --dart-define');
  Agent.environment['GEMINI_API_KEY'] = _apiKey;
  runApp(const App());
}

class App extends StatelessWidget {
  static const title = 'Example: Google Gemini AI';

  const App({super.key});

  @override
  Widget build(BuildContext context) =>
      const MaterialApp(title: title, home: ChatPage());
}

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

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: const Text(App.title)),
    body: AgentChatView(provider: DartanticProvider(agent: Agent('gemini'))),
  );
}
2
likes
150
points
160
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

AI chat widget for Flutter apps targeting mobile, desktop, and web supporting text, image, and voice input.

Repository (GitHub)
View/report issues

Topics

#ai #chat #gemini

License

BSD-3-Clause (license)

Dependencies

cross_file, dartantic_ai, dartantic_interface, file_selector, flutter, flutter_context_menu, flutter_markdown_plus, flutter_picture_taker, google_fonts, image_picker, mac_menu_bar, mime, super_clipboard, universal_platform, url_launcher, uuid, waveform_recorder

More

Packages that depend on dartantic_chat