# flutterjsx **Repository Path**: llf919329450/flutterjsx ## Basic Information - **Project Name**: flutterjsx - **Description**: jsx转dart写法 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-12 - **Last Updated**: 2021-05-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Flutter.js Transpile JSX to dart widgets [![NPM Version][npm-image]][npm-url] ## Install ``` npm i -g flutterjsx ``` > Beta Version Hello Home ! As you know Flutter comes with dirty syntax, therefore I decided to develop jsx transpiler for flutter. Demo in Youtube ## Usage > $ cd YOUR_FLUTTER_APP_PATH and Run: > $ flutterjsx 1 - Flutter Widget (flutter_app/lib/HomePage.dart): ``` import 'package:flutter/material.dart'; class HomePageView extends StatelessWidget { static final jsxView = "HomePageView.jsx"; static final spaces = " "; build(BuildContext context) { } // afterBuild } ``` jsxView is required. spaces is optional. // afterBuild is required. 2 -JSX (flutter_app/lib/HomePageView.jsx): ``` const style = { wrapper: { padding: "32.0", margin: { top: 30, bottom: 10 }, }, text: { fontSize: 20, }, }; export default ( > ); ``` Other ways: ``` }/> }/> ``` > and after save hit (ctrl + f5 in vscode) to force hot reload. 3 - Output > I wish to make it prettier in future. ``` import 'package:flutter/material.dart'; class HomePageView extends StatelessWidget { static final jsxView = "HomePageView.jsx"; static final spaces = " "; build(BuildContext context) { return Container( child: Text("This is a simple text", style: TextStyle( fontSize: 15, color: Color(0xFF111111), )), padding: EdgeInsets.all(32.0), margin: EdgeInsets.only(top: 30, bottom: 10), color: Colors.red, ); } // afterBuild } ``` That's it Javascript + Flutter will kill it. [npm-image]: https://img.shields.io/npm/v/flutterjsx.svg?style=flat [npm-url]: https://www.npmjs.com/package/flutterjsx ## License WTF.