add selectecmode
This commit is contained in:
@@ -230,15 +230,45 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
drawer: MyDrawer(),
|
||||
body: isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: mapbox.MapWidget(
|
||||
onMapCreated: (controller) {
|
||||
mapboxMap = controller;
|
||||
},
|
||||
cameraOptions: mapbox.CameraOptions(
|
||||
center: mapbox.Point(
|
||||
coordinates: mapbox.Position(longitude, latitude)),
|
||||
zoom: 14.0,
|
||||
),
|
||||
: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Mode : "),
|
||||
DropdownButton<String>(
|
||||
value: selectedMode,
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: 'driving', child: Text("🚗 Voiture")),
|
||||
DropdownMenuItem(
|
||||
value: 'walking', child: Text("🚶 Marche")),
|
||||
DropdownMenuItem(
|
||||
value: 'cycling', child: Text("🚴 Vélo")),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
setState(() {
|
||||
selectedMode = value;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: mapbox.MapWidget(
|
||||
onMapCreated: (controller) {
|
||||
mapboxMap = controller;
|
||||
},
|
||||
cameraOptions: mapbox.CameraOptions(
|
||||
center: mapbox.Point(
|
||||
coordinates: mapbox.Position(longitude, latitude)),
|
||||
zoom: 14.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _drawRouteAndMarkers,
|
||||
|
Reference in New Issue
Block a user