flutter_ai_connector 0.0.2 copy "flutter_ai_connector: ^0.0.2" to clipboard
flutter_ai_connector: ^0.0.2 copied to clipboard

A unified Flutter interface for AI Assistants (OpenAI, Gemini, Groq) with Lottie and Voice support.

example/lib/main.dart

import 'package:flutter_ai_connector/flutter_ai_connector.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';

void main() async {
  await dotenv.load(fileName: ".env");
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    // DEVELOPER: Configure your AI settings here
    final config = AIConfig(
      apiKey: dotenv.env['GROQ_API_KEY'] ?? '',
      provider: AIProvider.groq,
      isMultimodal: true,
      systemPrompt: 'You are a lively Assistant.',
      modelId: 'qwen/qwen3-32b', // User specified model
    );

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter AI Connector',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.deepPurple,
          brightness: Brightness.dark,
        ),
        useMaterial3: true,
        scaffoldBackgroundColor: const Color(
          0xFF000000,
        ), // Pure Black for seamless look
        appBarTheme: const AppBarTheme(
          scrolledUnderElevation: 0,
          backgroundColor: Colors.transparent,
          titleTextStyle: TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
      ),
      home: ChatScreen(config: config),
    );
  }
}

class ChatScreen extends StatelessWidget {
  final AIConfig config;

  const ChatScreen({super.key, required this.config});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Flutter AI Connector"),
        centerTitle: true,
      ),
      extendBodyBehindAppBar: true,
      body: AIAssistantView(
        config: config,
        // customLottiePath: 'assets/robot.json',
      ),
    );
  }
}
3
likes
140
points
50
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A unified Flutter interface for AI Assistants (OpenAI, Gemini, Groq) with Lottie and Voice support.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

bloc_concurrency, dio, equatable, file_picker, flutter, flutter_bloc, flutter_tts, image_picker, langchain, langchain_google, langchain_openai, lottie, mime, speech_to_text

More

Packages that depend on flutter_ai_connector