GroupAnnotation constructor

GroupAnnotation({
  1. required String id,
  2. required Offset position,
  3. required String title,
  4. EdgeInsets padding = const EdgeInsets.all(20),
  5. Color color = Colors.blue,
  6. int zIndex = -1,
  7. bool isVisible = true,
  8. bool selected = false,
  9. bool isInteractive = true,
  10. required Set<String> dependencies,
  11. Offset offset = Offset.zero,
  12. Map<String, dynamic> metadata = const {},
})

Implementation

GroupAnnotation({
  required super.id,
  required Offset position,
  required String title,
  this.padding = const EdgeInsets.all(20),
  Color color = Colors.blue,
  int zIndex = -1, // Usually behind nodes
  bool isVisible = true,
  super.selected = false,
  super.isInteractive = true, // Groups should be selectable and interactive
  required Set<String> dependencies, // Groups always depend on nodes
  super.offset = Offset.zero,
  super.metadata,
}) : super(
       type: 'group',
       initialPosition: position,
       initialZIndex: zIndex,
       initialIsVisible: isVisible,
       initialDependencies: dependencies,
     ) {
  _calculatedSize = Observable(const Size(100, 100));
  _observableTitle = Observable(title);
  _observableColor = Observable(color);
}