All Projects → Parabeac → Parabeac Core

Parabeac / Parabeac Core

Licence: bsd-3-clause
It's OK to love Flutter and hate hand-coding design elements. Parabeac-Core converts design files into Flutter code.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Parabeac Core

Online
Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
Stars: ✭ 278 (-19.65%)
Mutual labels:  hacktoberfest, open-source
Augur
Python library and web service for Open Source Software Health and Sustainability metrics & data collection.
Stars: ✭ 304 (-12.14%)
Mutual labels:  hacktoberfest, open-source
Talk Android
📱😀 Video & audio calls through Nextcloud on Android
Stars: ✭ 282 (-18.5%)
Mutual labels:  hacktoberfest, open-source
Zds Site
Cœur du projet technique de Zeste de Savoir
Stars: ✭ 236 (-31.79%)
Mutual labels:  hacktoberfest, open-source
Open Pixel Art
A collaborative pixel art project to teach people how to contribute to open-source
Stars: ✭ 331 (-4.34%)
Mutual labels:  hacktoberfest, open-source
Openlibrary
One webpage for every book ever published!
Stars: ✭ 3,311 (+856.94%)
Mutual labels:  hacktoberfest, open-source
Social
🎉 Social can be used for work, or to connect to the fediverse!
Stars: ✭ 302 (-12.72%)
Mutual labels:  hacktoberfest, open-source
Opensourceresources
Free opensource Learning Resources related to Web-Development A to Z 🔥❤
Stars: ✭ 210 (-39.31%)
Mutual labels:  hacktoberfest, open-source
Letra Extension
Passively learn a new language every time you open a new tab
Stars: ✭ 323 (-6.65%)
Mutual labels:  hacktoberfest, open-source
Discord bot.py
🍺 A simple discord bot that helps you getting started within discord.py
Stars: ✭ 313 (-9.54%)
Mutual labels:  hacktoberfest, open-source
Doc2pen
An open source project aimed at making your student life easier!
Stars: ✭ 226 (-34.68%)
Mutual labels:  hacktoberfest, open-source
Open Sauced
🍕 This is a project to identify your next open source contribution.
Stars: ✭ 352 (+1.73%)
Mutual labels:  hacktoberfest, open-source
Server
☁️ Nextcloud server, a safe home for all your data
Stars: ✭ 17,723 (+5022.25%)
Mutual labels:  hacktoberfest, open-source
Fvid
fvid is a project that aims to encode any file as a video using 1-bit color images to survive compression algorithms for data retrieval.
Stars: ✭ 276 (-20.23%)
Mutual labels:  hacktoberfest, open-source
Go
The most flexible Gutenberg-first WordPress theme built for go-getters everywhere.
Stars: ✭ 218 (-36.99%)
Mutual labels:  hacktoberfest, open-source
Pysolfc
A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
Stars: ✭ 293 (-15.32%)
Mutual labels:  hacktoberfest, open-source
Hacktoberfest2020 Contributions
A beginner-friendly project to help you in open-source contributions. Made specifically for contributions in HACKTOBERFEST 2020! Hello World Programs and Algorithms! Please leave a star ⭐ to support this project! ✨
Stars: ✭ 196 (-43.35%)
Mutual labels:  hacktoberfest, open-source
Android
📱 Nextcloud Android app
Stars: ✭ 2,669 (+671.39%)
Mutual labels:  hacktoberfest, open-source
Gerador Validador Cpf
Biblioteca JS open-source para gerar e validar CPF.
Stars: ✭ 312 (-9.83%)
Mutual labels:  hacktoberfest, open-source
Animatify Ios
Animation, Effects & Transitions for iOS
Stars: ✭ 350 (+1.16%)
Mutual labels:  hacktoberfest, open-source

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

Designer Protocol · Understanding the code export · Contribute · Community · Dev.to · Debugging

Table of Contents

  1. What is Parabeac-Core

  2. Get Started

    1. Cloning the Repo
    2. Running the conversion
    3. Metrics
    4. Using State Management Configuration
  3. Running the exported Code

  4. How to create & run Parabeac eggs

  5. How it works

  6. How to contribute

What is Parabeac-Core?

Parabeac-Core is an open-source repository that converts design files into Flutter code. The biggest challenge in code conversion is achieving quality code, but in a tool like this, there’s so much variability in what quality code should look like. So Parabeac-Core is built in a way not to promise quality code, but to be driven by the community so that you can configure & tweak to you or your teams liking. See our Manifesto. We welcome contributors to improve Parabeac-Core, create Parabeac Eggs, & to join our Discord community!

Get Started

If you have any trouble with getting Parabeac-Core running, check out this video! Parabeac-Core Getting Started

Development on Windows is possible, too. However, this requires some setup.

Parabeac-Core now supports both Figma and Sketch! We have plans to expand in the future as Parabeac-Core is built to support more platforms by design.

Dependencies

Need a file to test with? Feel free to download one of our sample design files below (Make sure to duplicate the Design to your account if you're using Figma):

Cloning the Repo

Because parabeac-core contains the Sketch-Asset-Converter submodule, it is easier to clone the repo using the following command:

git clone --recurse-submodules https://github.com/Parabeac/Parabeac-Core.git

If you have already cloned the repo without the submodule, simply run the following command which will add Sketch-Asset-Converter:

git submodule update --init

In order to pull new changes from the repository, run the following command to also update the submodule:

git pull --recurse-submodules

For more information about git submodules, click here.

Running the conversion

We currently support both Sketch and Figma. See below for running the conversion for both Sketch and Figma.

Sketch

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. If you have any plugins make sure to put the plugins in the plugin folder
  3. In your terminal change directory to the root PBCore directory and run:
 $ pub get
 $ dart parabeac.dart -p <Absolute Path To Design File> -n <ProjectName> 

Figma

  1. Clone PBCore repo in order to get the code on your machine
  2. If you have any plugins make sure to put the plugins in the plugin folder
  3. In your terminal change directory to the root PBCore directory and run:
 $ pub get
 $ dart parabeac.dart -f <Figma File ID> -k <Figma API Key> -o <Absolute Path To Output Directory> 

If you're wondering about where to find your Figma File ID or Figma API Key Please Read Below:

Figma File ID and API Key

Since Figma operates from a cloud native approach we use the Figma File ID and a Figma User API Key in order to pull down your figma designs and run the conversion. Your Figma File ID is a unique ID used to identify your specific Figma File amoungst all other Figma Design Files. Your Figma API Key is a custom key assigned to your figma account that you generate in order to give Parabeac Core the ability to pull down your Figma File. In order to find your Figma File ID do the following:

  1. Go to your Figma Homepage at www.Figma.com
  2. Select your Design File
  3. Within your design File's URL is your Figma File ID. Simply take the value after Figma.com/file/. So in the URL https://www.figma.com/file/zXXWPWb5wJXd0ImGUjEU1X/parabeac_demo_alt?node-id=0%3A156 the Figma File ID is zXXWPWb5wJXd0ImGUjEU1X

In order to create a Figma API Token do the following:

  1. Go to your Figma Homepage at www.Figma.com
  2. Navigate to your user Profile
  3. Scroll Down to the "Create a new Personal Access Token"
  4. Create a new Personal Access Token with the name Parabeac, you should then be prompted with your new API Key. Make sure to copy this as you wont be able to access it again after you click confirm. (It should look something like this: 64522-a0e5509a-d5ce-47a8-880b-c295f9cb27ed

Metrics

Parabeac-core keeps track of how many times it is run. Although we do not collect any personal information, you can turn off metrics at any time by creating the environment variable PB_METRICS = "false".

Using State Management Configuration

State Management

Parabeac-Core is able to export to different state management systems such as BLoC & Provider. Every developer team creates their Flutter apps differently, we added this support to help map the conversion in a more thoughtful & custom way. See here for the release post for more details!

To set the state management configuration, head over to edit /Parabeac-Core/lib/configurations/configurations.json. In here you'll see code like the following

 {
    "default": {
        "widgetStyle": "Material",
        "widgetType": "Stateless",
        "widgetSpacing": "Expanded",
        "layoutPrecedence" : ["column", "row", "stack"]
    },
    "state-management" : "None"
}

Here you can replace the state-management property to bloc, provider, or riverpod.

For sample Sketch and Figma files you can use to test state management, please see Get Started

You can learn how to easily create your own state management configuration in the wiki, let us know if you're thinking about doing this and if you need any help!

Running the exported code

Requirements

  • Flutter
  • Dart

Steps

  1. Make sure you have flutter installed correctly. (You can run flutter doctor within your terminal to easily check)
  2. Move to the Flutter Projects Root Directory

If your Project utilizes Sketch Prototyping Skip to Step 5

  1. Within Main.dart import the main screen that you want the app to launch with from the screens folder
  2. Next change the home property of the MaterialApp that is being returned in the Build Method to the name of the Screen imported in Step 3
  3. Save Main.dart and Execute flutter run in your terminal

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.

You can also create your own eggs! By using our Parabeac Egg Template you can quickly define your own semantics and corresponding code generation which allows for the most flexible and robust export customization possible. You can also upload your eggs to our git-based marketplace for templates to help support the community going forward.

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.

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

Parabeac Design Protocol

Parabeac Design Protocol is our way of helping define UI/UX elements within Design Files for cleaner and more succinct code conversion. By adding naming-semantics to elements, symbols, and layer names to the design file, Parabeac-Core is able to identify specific UI elements & override interpretation & generation with a specific implementation.

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

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.

Upcoming & Known Issues

  • Plugin Duplication in the Plugin Service
  • Egg Marketplace
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].