codelessly_api 0.0.2 copy "codelessly_api: ^0.0.2" to clipboard
codelessly_api: ^0.0.2 copied to clipboard

unlisted

Codelessly Core API

example/example.md

Creating a new node #

import 'package:codelessly_api/codelessly_api.dart';
import 'package:json_annotation/json_annotation.dart';

part 'my_node.g.dart';

/// An example of how to create a new node.
@JsonSerializable()
class MyNode extends BaseNode {
  @override
  final String type = 'myNode';

  MyNode({
    required super.id,
    required super.name,
    required super.basicBoxLocal,
  });

  factory MyNode.fromJson(Map json) => _$MyNodeFromJson(json);

  @override
  Map toJson() => _$MyNodeToJson(this);
}