createGroupAnnotation method

GroupAnnotation createGroupAnnotation({
  1. required String id,
  2. required String title,
  3. required Offset position,
  4. required Size size,
  5. Color color = Colors.blue,
})

Creates a new group annotation with the specified position and size.

Groups are now manually sized and use fluid containment - any node completely within the group's bounds is considered part of the group.

Parameters

  • id: Unique identifier for the group
  • title: Display title shown in the group header
  • position: Top-left position of the group
  • size: Width and height of the group (minimum 100x60)
  • color: Color for the group header and background tint

Implementation

GroupAnnotation createGroupAnnotation({
  required String id,
  required String title,
  required Offset position,
  required Size size,
  Color color = Colors.blue,
}) {
  final groupAnnotation = GroupAnnotation(
    id: id,
    position: position,
    size: size,
    title: title,
    color: color,
  );

  return groupAnnotation;
}