tl_flutter_openai 1.0.19+20
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.
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(),
},
);
}
}