prolaxu/flutter-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prolaxu/flutter-php

Composer 安装命令:

composer require prolaxu/flutter-php

包简介

Build Flutter mobile UIs from PHP. Define screens, components, routes, and stores in PHP — a Flutter renderer turns the JSON manifest into a native app.

README 文档

README

Build Flutter mobile UIs entirely from PHP. Your app lives in app/MobileUI/ — you never touch Flutter except to build and publish. Paired with Flutter Kit renderer.

How it works

PHP (app/MobileUI/) → JSON manifest → Flutter renderer → Native app

You define screens, components, routes, stores, and theme in PHP classes. A CLI command generates app_structure.json. The Flutter renderer parses this JSON and renders the entire app at runtime — no Flutter code needed per project.

Installation

composer require prolaxu/flutter-php

The service provider auto-registers via Laravel package discovery.

Pair with Flutter Kit — the JSON-driven Flutter renderer.

Quick start

php artisan flutter-php:init-app MyApp
php artisan flutter-php:generate-structure

Serve at GET /api/app-structure. Point your Flutter Kit at this URL.

Structure

app/MobileUI/
├── AppStructure.php        # Manifest definition
├── Components/             # Reusable UI components (ProductCard, etc.)
├── Screens/                # Screen definitions
├── Stores/                 # Reactive state stores
└── Theme/                  # App theme

packages/flutter-php/src/UIBuilder/
├── Components/             # 33 built-in components (Scaffold, Row, RemoteList, etc.)
├── Actions/                # 20+ action types (navigate, apiCall, setStoreValue, etc.)
├── Structure/              # App manifest structure (routes, environment, etc.)
├── State/                  # Store references and state bindings
├── Primitives/             # Text, TextStyle, Color, Padding, etc.
└── Base/                   # UIComponent base class

Defining a screen

class HomeScreen
{
    public static function build(): UIComponent
    {
        return new Scaffold(
            title: new Text('My App'),
            body: new Column(
                children: [
                    new TextComponent(new Text('Hello from PHP!')),
                ],
            ),
        );
    }
}

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-12