build method

  1. @override
Widget build(
  1. AMapContext aMapContext,
  2. Widget child
)
override

Implementation

@override
Widget build(AMapContext aMapContext, Widget child) {
  return Stack(
    key: ValueKey(this),
    children: [
      child,
      StreamBuilder<InfoWindowExtension>(
          initialData: this,
          stream: _streamController.stream,
          builder: (context, snapshot) {
            final data = snapshot.data;
            if (data == null ||
                !(data.option?.show ?? false) ||
                data._x == null) {
              return Container();
            }

            return Positioned(
              top: data._y,
              left: data._x,
              child: Container(
                key: _infoWindowKey,
                margin: data.option?.offset,
                child: infoWindow,
              ),
            );
          }),
    ],
  );
}