show static method

void show({
  1. required String identify,
  2. required BuildContext context,
  3. required GameComponent target,
  4. required Widget child,
  5. Offset align = Offset.zero,
})

Use this method to show a widget what follow the component

Implementation

static void show({
  required String identify,
  required BuildContext context,
  required GameComponent target,
  required Widget child,
  Offset align = Offset.zero,
}) {
  final overlay = OverlayEntry(
    builder: (context) {
      return FollowerWidget(
        target: target,
        align: align,
        child: child,
      );
    },
  );

  Overlay.of(context)?.let((over) {
    over.insert(overlay);
    _mapOverlayEntry[identify] = overlay;
  });
}