PHP code example of prolaxu / flutter-php
1. Go to this page and download the library: Download prolaxu/flutter-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
prolaxu / flutter-php example snippets
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!')),
],
),
);
}
}
PHP (app/MobileUI/) → JSON manifest → Flutter renderer → Native app
bash
composer bash
php artisan flutter-php:init-app MyApp
php artisan flutter-php:generate-structure