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

unlisted

Codelessly Core API

example/example.md

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);
}