codelessly_api 0.0.7 codelessly_api: ^0.0.7 copied to clipboard
Flutter's layouts and widgets represented as models and JSON data. This API is used by the Codelessly Editor and CloudUI SDK to render Flutter Widgets.
Creating a new node #
import 'package:codelessly_api/codelessly_api.dart';
import 'package:json_annotation/json_annotation.dart';
part 'custom_node.g.dart';
/// An example of how to create a new node.
@JsonSerializable()
class CustomNode extends BaseNode {
@override
final String type = 'custom_node';
CustomNode({
required super.id,
required super.name,
required super.basicBoxLocal,
});
factory CustomNode.fromJson(Map json) => _$CustomNodeFromJson(json);
@override
Map toJson() => _$CustomNodeToJson(this);
}