0.2.4 • Published 10 months ago

@dwebghost/flutjsx-core v0.2.4

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Flutjsx 🔥

Welcome to flutjsx project. This project is a proof of concept of a JSX to Flutter compiler.

How to use:

  1. Create a new react project
  2. npm i -D @dwebghost/flutjsx-core
  3. Transpile your JSX files to Flutter
import { JSXToFlutter } from "@dwebghost/flutjsx-core";
import { Main } from "./src/components/main"; //This is your main component

JSXToFlutter(
    {
        component: <Main></Main>,
        outputDir: "./dist/dart-code"
    }
)

This TSX code:

import Column from '@dwebghost/flutjsx-core/dist/components/Column'
import Container from '@dwebghost/flutjsx-core/dist/components/Container'
import Scaffold from '@dwebghost/flutjsx-core/dist/components/Scaffold'
import Text from '@dwebghost/flutjsx-core/dist/components/Text'
export default function MainScreen() {
    const name = "Lukebana Ndontoni"
    return (
        <Scaffold>
            <Column>
                <Container>
                    <Text>Hello {name}</Text>
                </Container>
                <Text>How are you doing today?</Text>
            </Column>
        </Scaffold>
    )
}

Will be compiled to:

import 'package:flutter/material.dart';

class FlutjsxWidget extends StatelessWidget {
  const FlutjsxWidget({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Container(
            child: Text("Hello Lukebana Ndontoni2"),
          ),
          Text("How are you doing today?"),
        ],
      ),
    );
  }
}

TODO:

  • Add more components
  • Add more examples
  • Improve documentation
  • Add javascript support for dart runtime
  • Add tests
0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago