Skip to main content

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

A reusable Flutter chatbot package with API integration, session management, interactive options, and customizable UI.

example/lib/main.dart

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

void main() {
  runApp(const ExampleApp());
}

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

  /// base credentials for api
  final chatApiCredentials = const ChatbotApiCredentials(
    ///base url for api
    baseUrl: 'https://example.com/api',

    /// endpoint to send messages
    messageEndpoint: 'messageEndpoint',

    ///endpoint to send option selection
    optionEndpoint: 'optionEndpoint',

    /// endpoint to get current session
    sessionEndpoint: 'sessionEndpoint',

    ///endpoint to get history of previous chats
    threadsEndpoint: 'threadsEndpoint',
  );

  /// Current user (or static)
  final user = const ChatbotUser(
    orgId: 'example-org',
    userId: 'example-user',
    contactId: 'example-contact',
    email: 'example@example.com',
    orgCode: 'example',
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'iServe Chatbot Example',
      home: Scaffold(
        body: iServeChatbot(
          user: user,
          chatApiCredentials: chatApiCredentials,
          showChatHistoryMenu: true,
        ),
      ),
    );
  }
}
4
likes
150
points
605
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A reusable Flutter chatbot package with API integration, session management, interactive options, and customizable UI.

Homepage

License

MIT (license)

Dependencies

dio, flutter, flutter_bloc, intl, shared_preferences

More

Packages that depend on iserve_chatbot