Skip to main content

ai_chat_composer 0.1.0 copy "ai_chat_composer: ^0.1.0" to clipboard
ai_chat_composer: ^0.1.0 copied to clipboard

A polished, accessible and backend-neutral multimodal prompt composer for Flutter AI applications.

example/main.dart

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

void main() => runApp(const ExampleApp());

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  String? model = 'fast';
  String lastPrompt = 'Write a prompt below.';

  @override
  Widget build(BuildContext context) => MaterialApp(
    theme: ThemeData(colorSchemeSeed: Colors.indigo),
    home: Scaffold(
      appBar: AppBar(title: const Text('AI Chat Composer')),
      body: Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          children: [
            Expanded(child: Center(child: Text(lastPrompt))),
            AiChatComposer(
              models: const [
                AiModelOption(id: 'fast', label: 'Fast'),
                AiModelOption(id: 'smart', label: 'Smart'),
              ],
              selectedModel: model,
              onModelChanged: (value) => setState(() => model = value),
              onSend: (prompt) => setState(() => lastPrompt = prompt.text),
            ),
          ],
        ),
      ),
    ),
  );
}
1
likes
150
points
412
downloads

Documentation

API reference

Publisher

verified publishersyedwaleednawaz.com

Weekly Downloads

A polished, accessible and backend-neutral multimodal prompt composer for Flutter AI applications.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #widget #chat #accessibility

License

MIT (license)

Dependencies

flutter

More

Packages that depend on ai_chat_composer