tl_flutter_openai 1.0.19+20 copy "tl_flutter_openai: ^1.0.19+20" to clipboard
tl_flutter_openai: ^1.0.19+20 copied to clipboard

Flutter library for work with OpenAI API. You can easily create AI prototype with this library.

example/lib/main.dart

import 'dart:async';

import 'package:example/chat_completion_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';

Future<void> main() async {
  await dotenv.load();
  runApp(MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const ChatCompletionScreen(),
      themeMode: ThemeMode.dark,
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blue,
        iconTheme: const IconThemeData(color: Colors.white),
        scaffoldBackgroundColor: Colors.grey[900],
        textTheme: const TextTheme(
          bodyMedium: TextStyle(
            fontWeight: FontWeight.w500, //
          ),
        ),
        colorScheme: ColorScheme.dark().copyWith(
          surface: Colors.grey[900], //
        ),
        drawerTheme: DrawerThemeData(
          backgroundColor: Colors.grey[900], //
        ),
      ),
      initialRoute: '/chat-completion',
      routes: {
        '/chat-completion': (c) => const ChatCompletionScreen(),
        '/audio': (c) => const ChatCompletionScreen(),
      },
    );
  }
}
7
likes
50
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter library for work with OpenAI API. You can easily create AI prototype with this library.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

cupertino_icons, dio, flutter, flutter_dotenv, flutter_localizations, freezed_annotation, intl, json_annotation

More

Packages that depend on tl_flutter_openai