Skip to content
Snippets Groups Projects
Commit 0edb98f6 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: add some commenting

parent 68799d9e
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ class _DefaultPageState extends State<DefaultPage> {
// Load marker data from server
loadMarkerList();
// Schedule fetchMarkerTemplate to run periodically based on fetchInterval const
// Schedule fetchMarkerData to run periodically based on fetchInterval from consts
const Duration interval = Duration(minutes: fetchInterval);
_timer = Timer.periodic(interval, (timer) {
fetchMarkerData();
......@@ -72,7 +72,7 @@ class _DefaultPageState extends State<DefaultPage> {
Widget build(BuildContext context) {
return MaterialApp(
home: Container(
decoration: const BoxDecoration(
decoration: const BoxDecoration( // Set background color
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
......@@ -82,10 +82,10 @@ class _DefaultPageState extends State<DefaultPage> {
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text('IceMap'),
title: const Text('IceMap'),
),
body: ListView(
children: [
children: [ // Add main widget
MapContainerWidget(markerList: markerList),
],
),
......
......@@ -26,6 +26,6 @@ Future<List<Measurement>> fetchMarkerData() async {
}
} catch (e) {
print('Error: $e');
throw Exception('Failed to connect to the server. Please check your network connection');
throw Exception('failed to connect to the server. Please check your network connection');
}
}
......@@ -36,7 +36,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
const SizedBox(height: contPadding),
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Stack(
child: Stack( // Stack quick view on top of map
children: [
SizedBox(
width: screenWidth * boxWidth,
......@@ -47,7 +47,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
zoom: 9.0,
),
children: [
TileLayer(
TileLayer( // Map from OpenStreetMap
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: const ['a', 'b', 'c'],
),
......@@ -55,7 +55,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
polygons: widget.markerList.map((Measurement measurement) {
return Polygon(
points: measurement.cornerList.map((Corner corner) {
// Match corners to LatLng objects
// Map corners to LatLng objects
return LatLng(corner.latitude, corner.longitude);
}).toList(),
/*onTap: () {
......@@ -71,7 +71,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
],
),
),
Positioned(
Positioned( // Quick view box layered over map
bottom: 10,
right: 10,
child: ClipRRect(
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment