ecra de mapa adicionado
This commit is contained in:
34
lib/screens/google_map_screen.dart
Normal file
34
lib/screens/google_map_screen.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class GoogleMapScreen extends StatefulWidget {
|
||||
const GoogleMapScreen({super.key});
|
||||
|
||||
@override
|
||||
State<GoogleMapScreen> createState() => _GoogleMapScreenState();
|
||||
}
|
||||
|
||||
class _GoogleMapScreenState extends State<GoogleMapScreen> {
|
||||
late GoogleMapController mapController;
|
||||
|
||||
final LatLng _center = const LatLng(38.7223, -9.1393); // Lisbon coordinates
|
||||
|
||||
void _onMapCreated(GoogleMapController controller) {
|
||||
mapController = controller;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Mapa da Corrida'),
|
||||
backgroundColor: Colors.black, // or your AppColors.background
|
||||
elevation: 0,
|
||||
),
|
||||
body: GoogleMap(
|
||||
onMapCreated: _onMapCreated,
|
||||
initialCameraPosition: CameraPosition(target: _center, zoom: 13.0),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user