ikchatbot 1.0.2
ikchatbot: ^1.0.2 copied to clipboard
ikChatBot is a powerful fully customizable chatbot you can add to your flutter project for all plaftorms
example/lib/main.dart
import 'package:example/response.dart';
import 'package:flutter/material.dart';
import 'package:ikchatbot/ikchatbot.dart';
import 'keywords.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final chatBotConfig = IkChatBotConfig(
//SMTP Rating to your mail Settings
ratingIconYes: const Icon(Icons.star),
ratingIconNo: const Icon(Icons.star_border),
ratingIconColor: Colors.black,
ratingBackgroundColor: Colors.white,
ratingButtonText: 'Submit Rating',
thankyouText: 'Thanks for your rating!',
ratingText: 'Rate your experience:',
ratingTitle: 'Thank you for using the chatbot!',
body: 'This is a test email sent from Flutter and Dart.',
subject: 'Test Rating',
recipient: '[email protected]',
isSecure: false,
senderName: 'Your Name',
smtpUsername: 'Your Email',
smtpPassword: 'your password',
smtpServer: 'stmp.gmail.com',
smtpPort: 587,
//Settings to your system Configurations
sendIcon: const Icon(Icons.send, color: Colors.black),
userIcon: const Icon(Icons.person, color: Colors.white),
botIcon: const Icon(Icons.android, color: Colors.white),
botChatColor: const Color.fromARGB(255, 81, 80, 80),
delayBot: 100,
closingTime: 1,
delayResponse: 1,
userChatColor: Colors.blue,
waitingTime: 1,
keywords: keywords,
responses: responses,
backgroundColor: Colors.white,
backgroundImageUrl: 'https://cdn.wallpapersafari.com/54/0/HluF7g.jpg',
initialGreeting:
"👋 Hello! \nWelcome to IkBot\nHow can I assist you today?",
defaultResponse: "Sorry, I didn't understand your response.",
inactivityMessage: "Is there anything else you need help with?",
closingMessage: "This conversation will now close.",
inputHint: 'Send a message',
waitingText: 'Please wait...',
);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text('ikChatBot Example'),
),
body: IkChatBot(config: chatBotConfig),
);
}
}