zowie_conversation_sdk 2.0.2
zowie_conversation_sdk: ^2.0.2 copied to clipboard
Zowie Conversation SDK for Flutter — embed the Zowie chat and your AI agent in your Flutter app.
example/example.md
Example #
A minimal app that shows the chat full screen, sends a message from a button and listens to chat events.
import 'package:flutter/material.dart';
import 'package:zowie_conversation_sdk/zowie_conversation_sdk.dart';
void main() => runApp(const MaterialApp(home: ChatScreen()));
class ChatScreen extends StatefulWidget {
const ChatScreen({super.key});
@override
State<ChatScreen> createState() => _ChatScreenState();
}
class _ChatScreenState extends State<ChatScreen> {
final _controller = ZowieChatController.create();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Support'),
actions: [
IconButton(
icon: const Icon(Icons.waving_hand),
onPressed: () => _controller.sendMessage('Hello!'),
),
],
),
body: ZowieChat(
config: const ZowieChatConfig(
baseUrl: 'https://<slug>.chat.getzowie.com',
instanceId: '<your-instance-id>',
metadata: ZowieChatMetadata(
name: 'Jane Doe',
email: 'jane@example.com',
),
),
controller: _controller,
onEvent: (event) {
switch (event) {
case ZowieChatStarted(conversationId: final id):
debugPrint('Conversation started: $id');
default:
break;
}
},
),
);
}
}
See the package README for all configuration options, the controller API, link and download handling, and push notifications.