diff --git a/app/lib/main.dart b/app/lib/main.dart index b409919922a6970ff7f020c178d86b211aa18595..5f05bf52fdcd0b680c8dc64243f37cecd48f9fab 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:latlong2/latlong.dart'; // Import LatLng class from the latlong package import 'dart:async'; import 'dart:io'; @@ -8,6 +10,7 @@ const String mapEndpoint = "update_map"; // NB: if http connection fails, run: adb reverse tcp:8443 tcp:8443 const int fetchInterval = 5; +// main is the entry point for the application, and starts the App() function void main() { runApp(const App()); } @@ -50,6 +53,7 @@ class DefaultPage extends StatefulWidget { class _DefaultPageState extends State<DefaultPage> { late Timer _timer; + // Timer initializer @override void initState() { super.initState(); @@ -63,6 +67,7 @@ class _DefaultPageState extends State<DefaultPage> { }); } + // Fetch timer @override void dispose() { // Cancel timer on widget termination @@ -90,13 +95,25 @@ class _DefaultPageState extends State<DefaultPage> { width: screenWidth * boxWidth, height: screenWidth * boxHeight, color: Colors.blue, + child: FlutterMap( + options: MapOptions( + center: LatLng(51.5, -0.09), // Initial center of the map (latitude and longitude) + zoom: 13.0, // Initial zoom level of the map + ), + children: [ // Add layers directly as children + TileLayer( + urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + subdomains: ['a', 'b', 'c'], + ), + ], + ), ), SizedBox(height: 20), Container( // Detailed info container width: screenWidth * boxWidth, height: screenWidth * boxHeight, color: Colors.blue, - child: Align( + child: const Align( alignment: Alignment.topLeft, child: Padding( padding: EdgeInsets.only(top: 10, left: 10), // Edge padding, text diff --git a/app/pubspec.lock b/app/pubspec.lock index 399063b499604d182c12d45fdff6536548b85f9f..29ec17a46d8598260b9d81c6ec4ef924f60898a6 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -62,6 +62,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + flutter_map: + dependency: "direct main" + description: + name: flutter_map + sha256: "52c65a977daae42f9aae6748418dd1535eaf27186e9bac9bf431843082bc75a3" + url: "https://pub.dev" + source: hosted + version: "4.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -83,6 +91,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + latlong2: + dependency: "direct main" + description: + name: latlong2 + sha256: "08ef7282ba9f76e8495e49e2dc4d653015ac929dce5f92b375a415d30b407ea0" + url: "https://pub.dev" + source: hosted + version: "0.8.2" lints: dependency: transitive description: @@ -91,6 +115,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" matcher: dependency: transitive description: @@ -115,6 +147,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: @@ -123,6 +163,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" sky_engine: dependency: transitive description: flutter @@ -176,6 +232,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" typed_data: dependency: transitive description: @@ -184,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" vector_math: dependency: transitive description: @@ -200,5 +272,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" sdks: - dart: ">=3.2.6 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=3.3.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index ad954a096aa49565c0bc9bd7fac7ed3a5425e1fb..7d385a53bf526fef8a336ccb16d1bc9e5726088b 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -4,12 +4,15 @@ publish_to: 'none' version: 0.1.0 environment: - sdk: '>=3.2.6 <4.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: flutter: sdk: flutter + flutter_map: ^4.0.0 http: ^0.13.3 + latlong2: ^0.8.2 + dev_dependencies: