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

Gemini Chatbot is a Flutter package that integrates Google Gemini AI to create an AI-powered chatbot.use predefined trained responses, and easily integrate the chatbot into their applications.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:gemini_chatbot/gemini_chatbot.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: ChatbotScreen(),
    );
  }
}

class ChatbotScreen extends StatefulWidget {
  const ChatbotScreen({super.key});

  @override
  State<ChatbotScreen> createState() => _ChatbotScreenState();
}

class _ChatbotScreenState extends State<ChatbotScreen> {
  @override
  Widget build(BuildContext context) {
    final String apiKey = "YOUR_GEMINI_API_KEY"; // Replace with a real API key
    final Map<String, String> trainedData = {
      "Hello": "Hi! How can I help you?",
      "What is Flutter?": "Flutter is an open-source UI toolkit by Google.",
      "How do I use this chatbot?":
          "Just type your question and get a response.",
    };
    return Scaffold(
      appBar: AppBar(title: Text("Gemini AI Chatbot")),
      body: GeminiChatbot(apiKey: apiKey, trainedData: trainedData),
    );
  }
}
0
likes
135
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

Gemini Chatbot is a Flutter package that integrates Google Gemini AI to create an AI-powered chatbot.use predefined trained responses, and easily integrate the chatbot into their applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, google_generative_ai, http

More

Packages that depend on gemini_chatbot