show static method
void
show({
- required String identify,
- required BuildContext context,
- required GameComponent target,
- required Widget child,
- Offset offset = Offset.zero,
- AlignmentGeometry? alignment,
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 offset = Offset.zero,
AlignmentGeometry? alignment,
}) {
final overlay = OverlayEntry(
builder: (context) {
return FollowerWidget(
target: target,
offset: offset,
alignment: alignment,
child: child,
);
},
);
// ignore: invalid_null_aware_operator
Overlay.of(context)?.let((over) {
over.insert(overlay);
_mapOverlayEntry[identify] = overlay;
});
}