mirror of
https://github.com/supleed2/ELEC60013-ES-CW1.git
synced 2024-11-10 01:35:50 +00:00
Added basic Google Map
This commit is contained in:
parent
1d92162f7d
commit
0785b1649c
29
lib/map.dart
29
lib/map.dart
|
@ -1,10 +1,35 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class MapPage extends StatelessWidget {
|
||||
class MapPage extends StatefulWidget {
|
||||
const MapPage({ Key? key }) : super(key: key);
|
||||
|
||||
@override
|
||||
_MapPageState createState() => _MapPageState();
|
||||
}
|
||||
|
||||
class _MapPageState extends State<MapPage> {
|
||||
late GoogleMapController _mapController;
|
||||
|
||||
// This will be changed, to center around the dog (once app reads data from the server)
|
||||
final LatLng _center = const LatLng(51.498356, -0.176894);
|
||||
|
||||
void _onMapCreated(GoogleMapController mapController) {
|
||||
_mapController = mapController;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text("Map Page");
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
body: GoogleMap(
|
||||
onMapCreated: _onMapCreated,
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: _center,
|
||||
zoom: 16.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue