dj

Auto-Generate Dart and Flutter Code while retaining manual user updates to generated code.

Usage

A simple usage example:

import 'package:dj/dj.dart';

void main() {
  var outputDir = '..\\lib';

  var baseDj = BaseDj(
    path: outputDir,
    node: DirectoryDj(
      name: 'dj_generated',
      nodes: [
        FileDj(
          name: 'hello_world',
          codeParts: [
            // This import is really not needed in generated file
            // Adding this line for demonstration only!
            ImportDj(importStr: 'package:io/io.dart'),
            FunctionDj(
              description: 'Main entry point to this file!',
              outputType: VariableType.Void,
              name: 'main',
              bodyCodeParts: [
                FunctionCallDj(
                  name: 'print',
                  args: ["'Hellow World!'"],
                ),
              ],
            ),
          ],
        ),
      ],
    ),
  );

  // Generating Json for Auto-Generated code
  var baseDjMap = baseDj.toJson();

  print('Auto-Generated Code:');
  print(baseDjMap);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Libraries

base
base_dj_io
base_widget_dj
boolean
class
code_djs
code_part
comment_line_checker
comments
commetns_utils
condition
data_type
data_types
directory
directory_dj_io
dj
dj_converter
dj_fc
dj_io
dj_names_map_writer
djs
dynamic_parameter_parser
empty_line
enum
export
field
file
file_dj_io
flutter_sdk_widget_processor
function
function_args
function_call
get_dj_names_map
if_else
import
main
manual_widget_dj
map
models
node
node_dj_io
parameter
process_sdk
raw_widget_dj
return
scripts
single_line
string
structure_djs
structure_types
utils
utils
utils
variable_declaration
variable_types
white_space_remover
widget_converter
widget_file_processor