flutter_gen_ai_chat_ui 2.0.3 copy "flutter_gen_ai_chat_ui: ^2.0.3" to clipboard
flutter_gen_ai_chat_ui: ^2.0.3 copied to clipboard

A comprehensive Flutter UI kit for AI chatbots, LLM interfaces, and conversational agents. Create beautiful chat UIs with Markdown support, code highlighting, streaming text responses, and extensive c [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';

import 'examples/home_screen.dart';
import 'examples/01_basic/basic_chat_screen.dart';
import 'examples/02_intermediate/intermediate_chat_screen.dart';
import 'examples/03_advanced/advanced_chat_screen.dart';

// For state management
import 'models/app_state.dart';

/// Main entry point for the Flutter Gen AI Chat UI Example App
void main() {
  runApp(const ExampleApp());
}

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

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (_) => AppState(),
      child: Consumer<AppState>(
        builder: (context, appState, _) {
          return MaterialApp(
            title: 'Flutter Gen AI Chat UI Examples',
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              colorScheme: ColorScheme.fromSeed(
                seedColor: Colors.indigo,
                brightness: Brightness.light,
              ),
              textTheme: GoogleFonts.interTextTheme(),
              useMaterial3: true,
            ),
            darkTheme: ThemeData.dark(useMaterial3: true).copyWith(
              colorScheme: ColorScheme.fromSeed(
                seedColor: Colors.indigo,
                brightness: Brightness.dark,
              ),
              textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme),
            ),
            themeMode: appState.themeMode,
            // Define all our routes
            initialRoute: '/',
            routes: {
              '/': (context) => const ExamplesHomeScreen(),
              '/basic': (context) => const BasicChatScreen(),
              '/intermediate': (context) => const IntermediateChatScreen(),
              '/advanced': (context) => const AdvancedChatScreen(),
            },
          );
        },
      ),
    );
  }
}

// For a more comprehensive example with advanced features:
// - See the 'comprehensive' directory which demonstrates:
//   - Streaming text responses
//   - Dark/light theme switching
//   - Custom message styling
//   - Animation control
//   - Markdown rendering with code blocks
53
likes
0
points
1.06k
downloads

Publisher

verified publisherdilacode.com

Weekly Downloads

A comprehensive Flutter UI kit for AI chatbots, LLM interfaces, and conversational agents. Create beautiful chat UIs with Markdown support, code highlighting, streaming text responses, and extensive customization for GPT, Gemini, Claude, and other AI models.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, flutter_animate, flutter_markdown, flutter_streaming_text_markdown, google_fonts, intl, permission_handler, provider, scrollable_positioned_list, shimmer, url_launcher

More

Packages that depend on flutter_gen_ai_chat_ui