atomicbi_flutter_ai 0.9.3 copy "atomicbi_flutter_ai: ^0.9.3" to clipboard
atomicbi_flutter_ai: ^0.9.3 copied to clipboard

A set of AI chat-related widgets for Flutter apps targeting mobile, desktop, and web.

example/lib/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const App());
}

final theme = ThemeData(
  brightness: Brightness.dark,
  primaryColor: const Color(0xff54346b),
  colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xff54346b), brightness: Brightness.dark),
  textTheme: const TextTheme(
    bodyMedium: TextStyle(color: Color(0xffeeeeee), fontSize: 14)
  ),
  tooltipTheme: TooltipThemeData(
    textStyle: TextStyle(color: const Color(0xffe9eef8)),
    decoration: BoxDecoration(
      color: const Color(0xff121721),
      border: Border.all(
        color: const Color(0xff04070f),
        style: BorderStyle.solid,
        width: 1
      ),
      borderRadius: BorderRadius.all(Radius.circular(4))
    )
  ),
);


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

  @override
  Widget build(BuildContext context) => MaterialApp(
    title: 'Atomic BI AI',
    home: const ChatPage(),
    theme: theme,
    debugShowCheckedModeBanner: false
  );
}

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

  @override
  Widget build(BuildContext context) => Scaffold(
    body: Container(
      constraints: BoxConstraints(minHeight: double.infinity),
      decoration: BoxDecoration(
        gradient: LinearGradient(
          begin: Alignment.topLeft,
          end: Alignment.bottomRight,
          colors: [Color(0xff1F122F), Color(0xff121B21)]
        )
      ),
      child: LlmChatView(
        style: getAtomicBITheme(theme),
        onReportCallback: (context, message, text) {
          print('report: $text');
        },
        provider: EchoProvider(
          history: [
            ChatMessage.llm()..text = 'Hi there',
            ChatMessage.user('What is 2 + 2?', []),
            ChatMessage.llm()..text = 'Offensive Content'
          ]
        )
      )
    )
  );
}
0
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A set of AI chat-related widgets for Flutter apps targeting mobile, desktop, and web.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cross_file, file_selector, flutter, flutter_context_menu, flutter_markdown_plus, flutter_picture_taker, google_fonts, image_picker, mime, universal_platform, uuid, waveform_recorder

More

Packages that depend on atomicbi_flutter_ai