robylon_flutter_sdk 0.0.1-staging.1 copy "robylon_flutter_sdk: ^0.0.1-staging.1" to clipboard
robylon_flutter_sdk: ^0.0.1-staging.1 copied to clipboard

Flutter SDK for Robylon - same logic and functionality as robylon-react-native-sdk.

example/lib/main.dart

// example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Robylon Flutter SDK Example',
      home: Scaffold(
        appBar: AppBar(title: const Text('Robylon Flutter SDK Example')),
        body: Chatbot(
          apiKey: 'YOUR_API_KEY',
          onEvent: _onEvent,
          onOpen: _onOpen,
          onClose: _onClose,
          onReady: _onReady,
        ),
      ),
    );
  }
}

void _onEvent(ChatbotEvent event) {
  debugPrint('Chatbot event: ${event.type}');
}

void _onOpen() {
  debugPrint('Chatbot opened');
}

void _onClose() {
  debugPrint('Chatbot closed');
}

void _onReady() {
  debugPrint('Chatbot ready');
}