ercode_cli 1.0.2%2B1

SDKdartflutter
Platformandroidioswindowslinuxmacos

Ercode CLI is an application to facilitate the process of creating Flutter applications faster, easier, and more simple.

Ercode CLI

Ercode CLI is an application to facilitate the process of creating Flutter applications faster, easier, and more simple. Ercode CLI will generate a module's code based on a JSON configuration.

Installation

// install
dart pub global activate ercode_cli 

// or with flutter
flutter pub global activate ercode_cli

// command use
ercode

Init Generator

ercode init

Setting URL API and token(optional) in file lib/helpers/constants.dart :

const baseUrl = '';
const apiToken = '';

Generate Code

example create module book with json config at generator/book.json :

{
    "name": "book",
    "fields": [
        {
            "name": "id",
            "type": "int",
            "primary": true,
            "hidden": true
        },
        {
            "name": "cover",
            "type": "String",
            "input": "image",
            "list": true
        },
        {
            "name": "name",
            "type": "String",
            "input": "text",
            "list": true
        },
        {
            "name": "author",
            "list": true
        },
        {
            "name": "genre"
        },
        {
            "name": "release_year",
            "type": "int"
        },
        {
            "name": "description"
            
        }
    ]
}

to generate code run command:

ercode generate generator/book.json

Paramaters Module

KeyRequiredDefaultDescription
nametrueModule name
apisame with nameendpoint API
modelsame with nameModel name
onlyThe list of modules that will be generated: model, repository, list, add, detail. If this is empty, then all of them will be generated.
fieldstrueList of fields that will be generated. Please see the Field parameters for details.

Paramaters Field

KeyRequiredDefaultDescription
nametrueField name
typetrueStringData types in Flutter : String, int, bool
inputtextType of field on create page: text, image
hiddenfalseTo indicate that this field will not appear on the create page
primaryfalseIndicating this field as primary key
listfalseIndicating this field will be shown on the list page