refactoring
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class LocationPickerScreen extends StatelessWidget {
|
||||
const LocationPickerScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sélectionnez une localisation'),
|
||||
backgroundColor: const Color(0xFF1E1E2C),
|
||||
),
|
||||
body: GoogleMap(
|
||||
initialCameraPosition: const CameraPosition(
|
||||
target: LatLng(48.8566, 2.3522), // Paris par défaut
|
||||
zoom: 12.0,
|
||||
),
|
||||
markers: <Marker>{
|
||||
Marker(
|
||||
markerId: const MarkerId('selectedLocation'),
|
||||
position: const LatLng(48.8566, 2.3522), // Position par défaut
|
||||
draggable: true,
|
||||
onDragEnd: (newPosition) {
|
||||
print('Nouvelle position sélectionnée: $newPosition');
|
||||
Navigator.of(context).pop(newPosition);
|
||||
},
|
||||
)
|
||||
},
|
||||
onTap: (position) {
|
||||
print('Position tapée: $position');
|
||||
Navigator.of(context).pop(position);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user