搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.0

lumen_ui

Lumen UI 是一個用於 Flutter 的 CLI 工具,可依需求產生模組化的 UI 組件,以保持應用程式輕量且易於維護。

AndroidiOSmacOSWindowsLinux
近 30 天下載
24
喜歡數
2
Pub 分數
130

安裝套件

flutter pub add lumen_ui

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Lumen UI 是一個用於 Flutter 的 CLI 工具,可自動產生模組化、可重複使用的 UI 元件。它透過按需建立結構良好的組件,協助開發者維持輕量且可擴展的應用程式。此工具與 Flutter 專案無縫整合,支援多個平台,確保在 Android、iOS、macOS、Windows 與 Linux 上呈現一致的 UI。透過促進模組化,Lumen UI 提升了程式碼組織性,並減少 UI 開發中的重複。

適用情境

  • 快速UI原型設計
  • 維持設計系統的一致性
  • 減少樣板程式碼
  • 擴展大型Flutter應用
  • 自動化組件創建

主要特色

  • CLI 驅動的組件生成
  • 模組化且可重用的元件範本
  • 跨平台支援
  • 輕量輸出
  • 與 Flutter pub 包系統整合

適合對象

  • Flutter 團隊優先考慮可維護性
  • 開發設計密集型應用的開發者
  • 需要快速UI迭代的項目
  • 使用組件化架構的團隊
  • 專注於前端的Flutter開發者

使用建議

  • 需要熟悉 CLI 工作流程
  • 生成後可能需要自訂
  • 依賴穩定的 Flutter 環境
  • 最適合在結構化的專案設定中使用
  • 不是執行時庫,而是一個開發工具

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Lumen UI

A CLI-based Flutter package for generating modular, customizable UI components on demand.

Motivation

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.

Features

  • Modular UI component generation
  • Customizable component templates
  • Theme and style configuration options
  • Material Design and Cupertino guideline compliance
  • Inline documentation for generated components

Full Documentation

For complete knowledge about the package, please visit the official documentation website:

Lumen UI Documentation

Installation

Follow these steps to set up your Flutter project and integrate Lumen UI:

1. Create a New Flutter Project

Using Flutter CLI
 flutter create my_app
 cd my_app
Using VS Code
  1. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)
  2. Type "Flutter: New Project"
  3. Select "Application"
  4. Choose project directory
  5. Name your project
Using Android Studio
  1. Click "New Flutter Project" from welcome screen
  2. Select Flutter project type
  3. Configure project settings
  4. Click "Finish"

📚 New to Flutter? Check out the official Flutter documentation for detailed setup instructions.

2. Add Lumen UI to Your Project

Add this line to your pubspec.yaml under dependencies:

dev_dependencies:
  flutter_test:
    sdk: flutter
  lumen_ui: 0.0.1 # Add Lumen UI package

3. Install Dependencies

Run this command in your project directory:

flutter pub get

4. Verify Installation

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.

Usage

dart run lumen_ui [options]
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
Component Types
  • button: Button components
  • dummy: Dummy components for testing
Component Naming Rules
  • Must start with a letter
  • Can contain letters, numbers, and underscores
  • Cannot contain spaces or special characters

Examples

List 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 

Output Structure

Components are generated in the following structure:

lib/ui/
  ├── buttons/
  │   └── primary_button
        └── primary_button.dart
  └── styles/
      └── color.dart
      └── styles.dart

Error Handling

Common error messages and solutions:

  • Both --type, --ui and --name are required: Ensure both -t, -u and -n options are provided
  • Invalid component name: Follow the component naming rules
  • Error parsing arguments: Check the command syntax
  • Invalid argument format: Verify option values are correct

Additional Commands

Show help:

dart run lumen_ui --help

Show version:

dart run lumen_ui --version

Architecture

The project follows a Layered Architecture pattern with:

  • HMI Layer: Command-line interface
  • Service Layer: Component generation and template services
  • Application Layer: Core business logic
  • Communication Layer: File system operations

Technology Stack

  • Dart SDK (>=2.18.0)
  • Flutter SDK (>=3.0.0)
  • Development Tools: VS Code, Android Studio
  • CLI Framework: args/cli_util

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Requirements

  • Processor: Intel Core i5 or equivalent
  • RAM: 8GB minimum (16GB recommended)
  • Storage: 500GB SSD
  • Operating Systems: Windows, macOS, or Linux

License

MIT License

Authors

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。