๐งฉ Zeba Academy Component Lab ๐ Canvas Document (Production README) ๐ฏ 1. Product Overview
Zeba Academy Component Lab is a Flutter-based interactive UI component playground designed to build, preview, edit, and document widgets in real time.
It acts like a lightweight Flutter Storybook + design system sandbox, enabling developers to visually experiment with UI components and instantly see code output.
๐ 2. Core Objective
This package is built to solve:
โ Lack of real-time widget preview tools in Flutter projects โ Hard-to-maintain UI documentation โ Manual UI testing without visual feedback โ No unified component exploration system โ Solution Provided
A single environment that combines:
Component browsing Live rendering Property editing Code generation Documentation viewing โจ 3. Key Features ๐งฉ Component Gallery Displays all registered UI components Organized and extendable registry system Quick selection interface ๐ Live Preview Engine Real-time widget rendering Instant UI updates on property changes Stateless + stateful component support ๐ Property Editor Panel Dynamic UI controls for widget customization Supports: String inputs Boolean toggles Extensible property types (future-ready) ๐ป Code Preview Panel Auto-generates Dart code from live state Helps developers learn and copy implementations Reflects real-time UI configuration ๐ Documentation Panel Displays component metadata Description and usage information Inline developer guidance ๐ 4. System Architecture ComponentLab (Main Shell) โ โโโ WidgetGallery โ โโโ Component selection UI โ โโโ LivePreview โ โโโ Real-time widget renderer โ โโโ PropertyPanel โ โโโ Dynamic input controls โ โโโ CodeView โ โโโ Generated Dart code output โ โโโ DocView โโโ Component documentation display ๐งฑ 5. Core Design System ๐ฆ Component Model
Each UI component is defined using:
ID Name Description Properties Builder function Code snippet ComponentModel( id, name, description, properties, builder, codeSnippet ) ๐ Property Model
Defines editable UI properties:
key label type default value PropertyModel( key, label, type, defaultValue ) โ Registry System
Central registry holds all components:
ComponentRegistry.components
Used for:
Listing UI components Feeding gallery UI Driving preview engine ๐ป Code Generation Engine
Converts UI state into Dart code:
Widget + Props โ Dart Code String
Purpose:
Developer learning Copy-ready output Debugging UI structure ๐ฆ 6. Installation Add dependency dependencies: zeba_academy_component_lab: ^0.0.1 ๐งช 7. Usage Basic Setup import 'package:flutter/material.dart'; import 'package:zeba_academy_component_lab/zeba_academy_component_lab.dart';
void main() { runApp(const MaterialApp( debugShowCheckedModeBanner: false, home: ComponentLab(), )); } ๐งฉ 8. Adding Custom Components
Developers can extend the system by registering new components:
ComponentModel(
id: "custom_button",
name: "Custom Button",
description: "Reusable styled button component",
properties:
PropertyModel(
key: "text",
label: "Button Text",
type: PropertyType.string,
defaultValue: "Click Me",
),
,
builder: (props) {
return ElevatedButton(
onPressed: () {},
child: Text(props"text"),
);
},
codeSnippet: '''
ElevatedButton(
onPressed: () {},
child: Text("Click Me"),
)
''',
);
๐ 9. Project Structure
lib/
โโโ zeba_academy_component_lab.dart
โโโ src/
โ โโโ core/
โ โ โโโ component_model.dart
โ โ โโโ property_model.dart
โ โ
โ โโโ engine/
โ โ โโโ component_registry.dart
โ โ โโโ code_generator.dart
โ โ
โ โโโ ui/
โ โ โโโ component_lab.dart
โ โ โโโ widget_gallery.dart
โ โ โโโ live_preview.dart
โ โ โโโ property_panel.dart
โ โ โโโ code_view.dart
โ โ โโโ doc_view.dart
โ โ
โ โโโ utils/
๐ 10. System Modules
Core Layer
ComponentModel
PropertyModel
Engine Layer
ComponentRegistry
CodeGenerator
UI Layer
ComponentLab (main shell)
WidgetGallery
LivePreview
PropertyPanel
CodeView
DocView
๐ 11. Roadmap
Phase 1 (Current)
โ Component registry system
โ Live preview engine
โ Property editor
โ Code generator
Phase 2 (Enhancements)
๐ฅ Drag & drop UI builder
๐ฅ JSON-based component schema
๐ฅ Save/load workspace state
๐ฅ Theme switching (Material 3 / Dark mode)
Phase 3 (Advanced)
๐ง AI component generator
๐ Plugin system support
๐ค Export full Flutter screens
โ Cloud sync for components
๐จโ๐ป 12. About Developer
Sufyan bin Uzayr Open-source developer focused on scalable Flutter ecosystems.
๐ https://sufyanism.com ๐ผ https://www.linkedin.com/in/sufyanism ๐ 13. Zeba Academy Ecosystem
A platform for learning modern development:
๐ https://zeba.academy ๐ https://code.zeba.academy โถ https://www.youtube.com/@zeba.academy ๐ธ https://www.instagram.com/zeba.academy ๐ 14. License
This project is licensed under:
GNU General Public License v3.0 (GPL-3.0)
You are free to:
Use Modify Distribute
Under the same license terms.
๐ https://www.gnu.org/licenses/gpl-3.0.html
โญ 15. Contribution
We welcome contributions:
โญ Star the repository ๐ด Fork the project ๐งฉ Add new components ๐ง Improve engine modules ๐ฉ Submit pull requests ๐งฉ End of Canvas Document