Skip to main content

kletso_flutter 0.2.0 copy "kletso_flutter: ^0.2.0" to clipboard
kletso_flutter: ^0.2.0 copied to clipboard

Embeddable Kletso AI chat for Flutter: streaming chat widget, launcher, server-driven UI (kletso.ui/v1) with host-registered components and the Kletso design tokens as a ThemeExtension. Pure Dart, Wasm-ready.

example/main.dart

// Minimal embed: initialise Kletso against the fake backend and show the chat.
// The full Acme Shop example app lives in the Kletso monorepo (apps/example_flutter).
import 'package:flutter/material.dart';
import 'package:kletso_core/fake.dart';
import 'package:kletso_flutter/kletso_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final backend = KletsoFakeBackend(scenario: const KletsoFakeScenario.demo());
  await Kletso.init(
    KletsoConfig(publishableKey: 'kl_pub_dev_example', agentId: 'agt_demo'),
    api: backend,
    transport: backend,
  );
  await Kletso.instance.identifyAnonymous();
  runApp(const ExampleApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        extensions: <ThemeExtension<dynamic>>[KletsoTheme.light()],
      ),
      home: Scaffold(
        appBar: AppBar(title: const Text('Kletso chat')),
        body: const KletsoChat(),
      ),
    );
  }
}
0
likes
0
points
700
downloads

Publisher

verified publisherkletso.ai

Weekly Downloads

Embeddable Kletso AI chat for Flutter: streaming chat widget, launcher, server-driven UI (kletso.ui/v1) with host-registered components and the Kletso design tokens as a ThemeExtension. Pure Dart, Wasm-ready.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #chat #chatbot #sdk #generative-ui

License

unknown (license)

Dependencies

flutter, kletso_core, kletso_ui_schema, meta

More

Packages that depend on kletso_flutter