Add Google Maps integration and update UI components; change platform version and minimum SDK
This commit is contained in:
@@ -1,23 +1,52 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class MapContent extends StatelessWidget {
|
||||
class MapContent extends StatefulWidget {
|
||||
const MapContent({super.key});
|
||||
|
||||
@override
|
||||
State<MapContent> createState() => _MapContentState();
|
||||
}
|
||||
|
||||
class _MapContentState extends State<MapContent> {
|
||||
static LatLng _pGooglePlex = LatLng(50.64864814740268, 3.7224066213297293);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.map, size: 80, color: Colors.green),
|
||||
SizedBox(height: 20),
|
||||
Text(
|
||||
'Page de la Carte',
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Rechercher un lieu',
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
Expanded(
|
||||
child: GoogleMap(
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: _pGooglePlex,
|
||||
zoom: 14.4746,
|
||||
),
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: MarkerId('googlePlex'),
|
||||
position: _pGooglePlex,
|
||||
infoWindow: InfoWindow(title: 'Google Plex'),
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Text('Ici sera intégrée Google Maps'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user