如何在 Flutter 中查找小部件的高度并设置 GoogleMap 的填充

问题描述

我正在使用 google_maps_flutter: ^1.1.1

我需要找到 Widget 的 height 并根据此 height 设置填充。

Here is the picture link

解决方法

看到这个:How to get height of a Widget?

你也可以使用这个包, https://pub.dev/packages/render_metrics 结合: https://pub.dev/packages/after_layout

第二个包用于第一次布局构建后的回调。