generative_ai_ui_builder 0.0.4
generative_ai_ui_builder: ^0.0.4 copied to clipboard
A Flutter plugin that uses Google Gemini generative AI to turn natural language prompts into Flutter UI code. Ideal for rapid prototyping and AI-assisted app development.
π¨ Generative AI UI Builder #
A Flutter plugin that leverages Google Gemini generative AI (now supporting gemini-2.0-flash π) to convert your natural language prompts into Flutter UI code β perfect for rapid prototyping, learning, and AI-assisted app development!
β¨ Features #
- π£οΈ Generate Flutter widget code from plain English prompts
- β‘ Integrates with Google Gemini (
gemini-2.0-flash) - π οΈ Easy to use, extend, and integrate into any Flutter project
- π‘ Great for beginners, educators, and professionals alike
π Getting Started #
Add the dependency to your pubspec.yaml:
dependencies: generative_ai_ui_builder: ^1.0.0
text
π Usage #
// 1οΈβ£ Import the package import 'package:generative_ai_ui_builder/generative_ai_ui_builder.dart';
// 2οΈβ£ Initialize the builder with your Gemini API key final aiBuilder = GenerativeAIUIBuilder('YOUR_GEMINI_API_KEY');
// 3οΈβ£ Call the generator with your UI prompt void generateCode(String prompt) async { // The AI will return Flutter widget code as a String! String code = await aiBuilder.generateFlutterUICode(prompt); print(code); // You can display or use this code in your app }
text
π‘ Example #
final prompt = "A login screen with email and password fields, and a login button."; final code = await aiBuilder.generateFlutterUICode(prompt);
// Now 'code' contains a ready-to-use Flutter widget! // Try pasting it into your project and see the magic! β¨
text
πΌοΈ Screenshots #
π Tips & Comments #
- π Never share your API key publicly! Store it securely in environment variables or secure storage.
- π§βπ» The plugin is designed for easy extensionβfeel free to add more AI models or tweak prompts for your needs.
- ποΈ Generated code is plain Dart β review and test before shipping to production.
- π If you hit API limits, check your Google Gemini quota and billing.
π License #
π Issues & Feedback #
Found a bug or have a feature request?
Please file issues and feature requests at GitHub Issues.
Your feedback helps make this plugin better! π
Happy coding! π