gemini_chat_fab 1.1.0
gemini_chat_fab: ^1.1.0 copied to clipboard
A plug-and-play floating Gemini AI chat assistant for Flutter apps.
import 'package:flutter/material.dart';
import 'package:gemini_chat_fab/gemini_chat_fab.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Gemini Chat FAB Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
// IMPORTANT: Replace with your actual API key
const geminiApiKey = String.fromEnvironment('GEMINI_API_KEY');
if (geminiApiKey.isEmpty) {
return const Scaffold(
body: Center(
child: Text('Add --dart-define=GEMINI_API_KEY=YOUR_KEY to your run command.'),
),
);
}
return Scaffold(
appBar: AppBar(
title: const Text('Package Demo App'),
),
body: const Center(
child: Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'This is a host app.\nPress the Floating Action Button to start a chat!',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
),
// Use the widget from your package here! ✅
floatingActionButton: const GeminiChatFab(
apiKey: geminiApiKey,
),
);
}
}