Files
TravelMate/lib/components/map/map_content.dart

54 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
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 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'),
),
},
),
),
],
),
),
),
);
}
}