Input Bar

Chat input bar with text field, send button, and attachment support. Handles multiline input, disabled state during streaming, and safe-area padding.

Preview

Preview
+
Message...
+
Tell me about Flutter widgets

Installation

$ flai add input_bar

Import

import 'package:my_app/flai/components/input_bar/input_bar.dart';

Usage

FlaiInputBar(
  onSend: (text) {
    print('User sent: $text');
  },
  placeholder: 'Ask anything...',
  onAttachmentTap: () {
    // Show image picker or file picker
  },
)

// Disabled during streaming
FlaiInputBar(
  onSend: handleSend,
  enabled: !isStreaming,
)

Properties

PropertyTypeDefaultDescription
onSend Function(String) required Called with the message text when send is tapped.
placeholder String 'Message...' Placeholder text for the input field.
onAttachmentTap VoidCallback? null Called when the attachment button is tapped. Button hidden if null.
enabled bool true Whether the input is enabled. Set to false during streaming.

Features