in packages/google_maps_flutter/google_maps_flutter/example/lib/place_polygon.dart [168:267]
Widget build(BuildContext context) {
final PolygonId? selectedId = selectedPolygon;
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Center(
child: SizedBox(
width: 350.0,
height: 300.0,
child: GoogleMap(
initialCameraPosition: const CameraPosition(
target: LatLng(52.4478, -3.5402),
zoom: 7.0,
),
polygons: Set<Polygon>.of(polygons.values),
onMapCreated: _onMapCreated,
),
),
),
Expanded(
child: SingleChildScrollView(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Row(
children: <Widget>[
Column(
children: <Widget>[
TextButton(
child: const Text('add'),
onPressed: _add,
),
TextButton(
child: const Text('remove'),
onPressed: (selectedId == null)
? null
: () => _remove(selectedId),
),
TextButton(
child: const Text('toggle visible'),
onPressed: (selectedId == null)
? null
: () => _toggleVisible(selectedId),
),
TextButton(
child: const Text('toggle geodesic'),
onPressed: (selectedId == null)
? null
: () => _toggleGeodesic(selectedId),
),
],
),
Column(
children: <Widget>[
TextButton(
child: const Text('add holes'),
onPressed: (selectedId == null)
? null
: ((polygons[selectedId]!.holes.isNotEmpty)
? null
: () => _addHoles(selectedId)),
),
TextButton(
child: const Text('remove holes'),
onPressed: (selectedId == null)
? null
: ((polygons[selectedId]!.holes.isEmpty)
? null
: () => _removeHoles(selectedId)),
),
TextButton(
child: const Text('change stroke width'),
onPressed: (selectedId == null)
? null
: () => _changeWidth(selectedId),
),
TextButton(
child: const Text('change stroke color'),
onPressed: (selectedId == null)
? null
: () => _changeStrokeColor(selectedId),
),
TextButton(
child: const Text('change fill color'),
onPressed: (selectedId == null)
? null
: () => _changeFillColor(selectedId),
),
],
)
],
)
],
),
),
),
],
);
}