onTap: widget.isSelecting ? _selectLocation : null,
markers: (_pickedLocation == null && widget.isSelecting)
? null
: {
Marker(
markerId: MarkerId('m1'),
position: _pickedLocation ??
LatLng(
widget.initialLocation.latitude,
widget.initialLocation.longitude,
),
),
}),发布于 2022-01-08 00:30:20
要么将markers变为可空的,即Set<Marker>? markers
或
如果此条件为真(_pickedLocation == null && widget.isSelecting),则传递空集而不是null
https://stackoverflow.com/questions/70624754
复制相似问题