lumen_ui
Lumen UI 是一個用於 Flutter 的 CLI 工具,可依需求產生模組化的 UI 組件,以保持應用程式輕量且易於維護。
Lumen UI 是一個創新且開源的 CLI 工具,專為 Flutter 所設計,透過按需產生 UI 組件來解決應用程式過於龐大的問題。此專案旨在建立一種模組化的方法,讓開發者僅需架設所需的特定組件,而非將整個 UI 庫作為相依性加入。
{"sdk":"flutter"}^2.5.0^1.8.3^3.1.2^0.19.0{"sdk":"flutter"}—^2.0.0^5.4.4^1.24.0^0.12.2+2以下為英文專案原文快照,最新內容請造訪 GitHub。
A CLI-based Flutter package for generating modular, customizable UI components on demand.
Flutter developers often struggle with bloated UI component libraries that increase app size and affect performance. Lumen UI CLI solves this by providing a command-line tool that generates only the components you need, with full customization options.
For complete knowledge about the package, please visit the official documentation website:
Follow these steps to set up your Flutter project and integrate Lumen UI:
flutter create my_app
cd my_app
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)📚 New to Flutter? Check out the official Flutter documentation for detailed setup instructions.
Add this line to your pubspec.yaml under dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lumen_ui: 0.0.1 # Add Lumen UI package
Run this command in your project directory:
flutter pub get
Run this command to verify the installation:
flutter pub list
You should see lumen_ui: 1.0.0 in the list of installed packages.
🎉 Congratulations! You're now ready to use Lumen UI in your Flutter project.
Continue to the Usage section to learn how to implement Lumen UI components.
dart run lumen_ui [options]
| Option | Alias | Description | Required |
|---|---|---|---|
--type |
-t |
Type of component to generate | Yes |
--name |
-n |
Name of the component | Yes |
--output |
-o |
Output directory (defaults to lib/ui) |
No |
--help |
-h |
Show help information | No |
--version |
-v |
Show version information | No |
--verbose |
- | Enable verbose logging | No |
button: Button componentsdummy: Dummy components for testingList all supported types and their related UIs:
dart run lumen_ui --list
List all supported component types:
dart run lumen_ui --list-types
List related UIs for a specific component type:
dart run lumen_ui --list-uis button
Generate a primary button:
dart run lumen_ui -t button -u primarybutton -n primary
Generate with custom output directory:
dart run lumen_ui -t button -u iconbutton -n iconbtn -o lib/components
Components are generated in the following structure:
lib/ui/
├── buttons/
│ └── primary_button
└── primary_button.dart
└── styles/
└── color.dart
└── styles.dart
Common error messages and solutions:
Both --type, --ui and --name are required: Ensure both -t, -u and -n options are providedInvalid component name: Follow the component naming rulesError parsing arguments: Check the command syntaxInvalid argument format: Verify option values are correctShow help:
dart run lumen_ui --help
Show version:
dart run lumen_ui --version
The project follows a Layered Architecture pattern with:
MIT License