Code Monkey home page Code Monkey logo

parabeac-core's Introduction

Parabeac-Core

Parabeac Logo

Parabeac-Core is an open-source repository that converts design files into Flutter code.

Parabeac - Open-source design to Flutter converter | Product Hunt Embed

google.com Discord Chat https://twitter.com/parabeac?lang=en Parabeac Contributor Covenant

How it works

Parabeac-Core is essentially broken up into 3 pieces which you can see in the list or animation below. While most of the magic is in the interpretation engine, you can view more animations & information here.

  1. Convert design file into Parabeac design protocol
  2. Interpretation Engine

Made up of the Visual, Layout, & Alignment generation services.

  1. Generate Flutter code

Parabeac High Level Animation

Visual Generation Service

These are mostly built by a one to one relationship from the Parabeac Design Language into Parabeac Intermediate Nodes. For example, a rectangle in the design language will simply convert to an InheritedContainer.

Parabeac Visual Generation Service Animation

Layout Generation Service

This service is a bit more interesting, as we break down each group of nodes to be laid out by the layout service. The service takes the first 2 nodes compares them & generates a layout, we grab the next node, compare it to the layout & then the leaves if needed to and continuously traverse the rest of the layer into the laid out tree that we construct.

Parabeac Layout Generation Service Animation

Alignment Generation Service

In Flutter, there are only a couple ways to achieve alignment. We recognized the following as the most common:

  • Flex-based layouts
  • Padding/margin
  • Positioning (Stacks)
  • Alignment (Container/Single Child/Visual Node)

Depending on the type of layout to add alignment to we have various services to take the nodes in and apply the alignment information needed.

Parabeac Alignment Generation Service Animation

Get Started

Parabeac currently supports conversions from Sketch but is designed to support more platforms in the future.

Dependencies

  • Dart
  • Flutter
  • Docker (We're working on removing this)

To test out a Sketch file feel free to download this Sketch file!

Running the conversion

Follow these steps in order to run Parabeac Core on your local environment:

  1. Clone PBCore repo in order to get the code on your machine
  2. Make sure you have docker running
  3. Within your terminal navigate to the sketch-to-svg folder within the Parabeac Core root directory. From here run docker build -t sketch .
  4. Within the same sketch-to-svg directory run docker run -p 5555:8081 -d sketch
  5. If you have any plugins make sure to put the plugins in the plugin folder
  6. In your terminal move to the root PBCore directory and run:
 $dart parabeac.dart -p <Absolute Path To Design File> -n <ProjectName> 

โš ๏ธ Note: Steps 3 and 4 create a docker container in the background, we know this is not ideal and are working to remove this currently. To remove the docker instance run docker ps to identify the container Id and then docker kill <containerId> to remove it. Please see the Docker docs for more details.

Running the exported code

Requirement(s)

  • Download Flutter
  • Traverse to main.dart
  • Call the screen you want to view
  • Execute flutter run

How to contribute

Welcome! The best way to contribute to Parabeac is through pull requests, filing issues on Github, writing documentation & helping others in our Discord community. We are an early project, but like many other projects, helping with bugs that others have filed on Stack Overflow is extremely helpful. We recommend filing bugs & feature requests on the Github issue tracker. For more details make sure to check out our wiki.

How to create & run Parabeac eggs

Parabeac eggs are essentially plugins that change the way a set of design elements are interpreted. A very simple example of this are 2 eggs that we created called NavBar & TabBar. Eggs are loaded into the project before the runtime of Parabeac-Core because unfortunately dart doesn't support dynamic module loading.

To add a Parabeac egg, download the egg and add it to the parabeac-core/plugins folder. When you run Parabeac-Core it will automatically grab & import the egg into the project.

Upcoming & Known Issues

  • Plugin Duplication in the Plugin Service
  • Remove Docker Dependency
  • Support for Figma
  • Egg Marketplace

parabeac-core's People

Contributors

ihuds577 avatar kevinapodaca avatar siliconivan avatar x64eddie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.