🎨 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

MIT


🐞 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! πŸš€