chatbot_support_kit 1.0.1
chatbot_support_kit: ^1.0.1 copied to clipboard
A customizable floating chatbot widget for Flutter apps. Drop-in chat UI with AI integration, WebSocket support, and beautiful animations.
import 'package:chatbot_support_kit/chatbot_support_kit.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
void main() {
runApp(
Sizer(
builder: (context, orientation, deviceType) {
return const MyApp();
},
),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ChatBot Widget Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const ChatBotWidget(
config: ChatConfig(
title: 'Support Bot',
themeColor: Color(0xFF007BFF),
initialMessage: 'Hi! How can I help you today?',
profilePicUrl: 'https://i.pravatar.cc/40',
apiKey: "your_api_key_here",
),
child: HomePage(),
),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('My App'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.chat_bubble_outline,
size: 80,
color: Colors.grey[400],
),
const SizedBox(height: 24),
Text(
'Flutter ChatBot Demo',
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 12),
Text(
'Tap the chat button in the bottom right corner',
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Colors.grey[600],
),
),
const SizedBox(height: 8),
Text(
'to start a conversation! 💬',
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Colors.grey[600],
),
),
],
),
),
);
}
}