codelessly_api 0.0.1 codelessly_api: ^0.0.1 copied to clipboard
Codelessly Core API
Creating a new node #
import 'package:codelessly_api/api.dart';
import 'package:json_annotation/json_annotation.dart';
part 'my_cool_node.g.dart';
/// At it's core, this is the most basic example of how to create a complete
/// [BaseNode].
@JsonSerializable()
class MyCoolNode extends BaseNode {
@override
final String type = 'myCoolNode';
MyCoolNode({
required super.id,
required super.name,
required super.basicBoxLocal,
});
factory MyCoolNode.fromJson(Map json) => _$MyCoolNodeFromJson(json);
@override
Map toJson() => _$MyCoolNodeToJson(this);
}