ai_chat_plus 1.0.1
ai_chat_plus: ^1.0.1 copied to clipboard
A Flutter package that provides AI chat functionality with enhanced features including OpenAI, Google Gemini, and Claude AI integrations, voice recognition, and multimodal support.
example/main.dart
import 'package:flutter/material.dart';
import 'pages/openai_page.dart';
import 'pages/gemini_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'AI Chat Plus Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('AI Chat Plus Example'),
centerTitle: true,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Choose AI Service',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 40),
// OpenAI Button
ElevatedButton.icon(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => const OpenAIChatPage()),
),
icon: const Icon(Icons.chat_bubble_outline),
label: const Text('OpenAI Chat'),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue.shade100,
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
),
minimumSize: const Size(200, 50),
),
),
const SizedBox(height: 20),
// Gemini Button
ElevatedButton.icon(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => const GeminiChatPage()),
),
icon: const Icon(Icons.psychology_outlined),
label: const Text('Gemini Chat'),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.deepPurple.shade100,
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
),
minimumSize: const Size(200, 50),
),
),
],
),
),
);
}
}