2022-02-09 16:06:37 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-02-09 16:49:50 +00:00
|
|
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
2022-02-09 16:06:37 +00:00
|
|
|
|
2022-02-09 16:49:50 +00:00
|
|
|
class MapPage extends StatefulWidget {
|
2022-02-09 16:06:37 +00:00
|
|
|
const MapPage({ Key? key }) : super(key: key);
|
|
|
|
|
2022-02-09 16:49:50 +00:00
|
|
|
@override
|
|
|
|
_MapPageState createState() => _MapPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MapPageState extends State<MapPage> {
|
|
|
|
late GoogleMapController _mapController;
|
|
|
|
|
2022-02-10 11:06:37 +00:00
|
|
|
// This will be changed, to center around the dog (once app reads metrics from the server)
|
2022-02-09 16:49:50 +00:00
|
|
|
final LatLng _center = const LatLng(51.498356, -0.176894);
|
|
|
|
|
|
|
|
void _onMapCreated(GoogleMapController mapController) {
|
|
|
|
_mapController = mapController;
|
|
|
|
}
|
|
|
|
|
2022-02-09 16:06:37 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-02-09 16:49:50 +00:00
|
|
|
return MaterialApp(
|
|
|
|
home: Scaffold(
|
|
|
|
body: GoogleMap(
|
|
|
|
onMapCreated: _onMapCreated,
|
|
|
|
initialCameraPosition: CameraPosition(
|
|
|
|
target: _center,
|
|
|
|
zoom: 16.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
2022-02-09 16:06:37 +00:00
|
|
|
}
|
|
|
|
}
|