App Scaffolds

Generate complete, ready-to-run Flutter apps with AI chat built in. Choose from a single-screen chat or a full multi-screen app with auth, settings, and conversation history.

Overview

App scaffolds go beyond individual components. Instead of assembling pieces one by one, scaffolds generate an entire working app structure in one command. They include routing, state management wiring, and all the FlAI components pre-connected.

There are two scaffold levels:

LevelCommandDescription
Basic flai scaffold basic Single chat screen with provider, theme, and input bar wired up
Full App flai scaffold app Multi-screen app with auth, chat list, settings, profile, and chat screen

Level 1: Basic Scaffold

The basic scaffold generates a minimal single-screen chat app. It is the fastest way to get a working AI chat interface running.

$ flai scaffold basic

What's included

Generated structure

lib/
  main.dart                  ← Entry point with FlaiTheme
  flai/
    core/                    ← Theme, models, provider interface
    components/
      chat_screen/
      message_bubble/
      input_bar/
      typing_indicator/
    providers/
      ai_provider.dart
    flai.dart

Running it

After scaffolding, run the app with your API key:

$ flutter run --dart-define=OPENAI_API_KEY=sk-...

You get a single screen with a chat header, scrolling message list, and input bar at the bottom. The AI responds in real time with streaming text.

Level 2: Full App Scaffold

The full app scaffold generates a complete multi-screen application with navigation, authentication, and persistent conversation history.

$ flai scaffold app

What's included

Generated structure

lib/
  main.dart                          ← Entry point with routing
  app/
    router.dart                      ← App navigation / routing
    auth/
      auth_screen.dart               ← Sign in / sign up
      auth_controller.dart
    home/
      home_screen.dart               ← Tab container
    settings/
      settings_screen.dart           ← Theme, model, API key config
    profile/
      profile_screen.dart            ← User info, sign out
  flai/
    core/                            ← Theme, models, provider interface
    components/
      chat_screen/
      message_bubble/
      input_bar/
      streaming_text/
      typing_indicator/
      thinking_indicator/
      tool_call_card/
      citation_card/
      code_block/
      conversation_list/
      model_selector/
      token_usage/
    providers/
      ai_provider.dart
      openai_provider.dart
    flai.dart

Screen by screen

Auth Screen

A clean sign-in/sign-up form styled with FlAI theme tokens. Includes email and password fields, a submit button, and a toggle between sign-in and sign-up modes. Wired to an AuthController you can connect to Firebase, Supabase, or any auth backend.

Conversation List

Displays all past conversations with titles, timestamps, and a search bar. Tap to resume a conversation or tap the new-chat button to start fresh. Uses the FlaiConversationList component.

Chat Screen

The main chat interface with all the bells and whistles: streaming text, thinking indicator for reasoning models, tool call cards, citation cards, code blocks with syntax highlighting, and the input bar with attachment support.

Settings Screen

Lets the user toggle between light and dark themes, select an AI model from the model selector, and configure their API key. All preferences persist locally.

Profile Screen

Shows user info (name, email) and provides a sign-out button. Designed to be extended with subscription or usage-tracking features.

Customization

Since scaffolds generate source code you own, you can customize everything after generation:

Scaffolds are a starting point, not a constraint. Think of them as a working template you customize for your specific app.

Basic vs Full App

FeatureBasicFull App
Chat screenYesYes
Streaming textYesYes
Message bubblesYesYes
Input barYesYes
Typing indicatorYesYes
Auth flowNoYes
Conversation listNoYes
Settings screenNoYes
Profile screenNoYes
Model selectorNoYes
Token usageNoYes
Thinking indicatorNoYes
Tool call cardsNoYes
Citation cardsNoYes
Navigation / routingNoYes
Components included412+