diff --git a/README.md b/README.md index f65581ece06e854cc0cac62e77df0e697b319be4..a944b9fc46360ba2f61bf30905497470cb812670 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ This software was developed at NTNU as part of a Bachelor thesis for the municipality of Gjøvik. ## Table of contents +* [IceMap sofwtare license](#icemap-software-license) * [Server](#server) * [Endpoints](#endpoints) * [Update map](#update-map) @@ -18,6 +19,22 @@ This software was developed at NTNU as part of a Bachelor thesis for the municip * [Application dependencies](#application-dependencies) * [Developers](#devleopers) +# IceMap software license +The IceMap software was produced by Joakim Aleksandersen, +Sara Savanovic Djordjevic, and Hoa Ben The Nguyen. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation to view the Software. +Any distribution and modification of the Software requires prior written +permission from the authors. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + # Server The server currently only accepts HTTPS requests, not HTTP. It listens on ip address 127.0.0.1 and port 8443. diff --git a/app/lib/pages/default_page.dart b/app/lib/pages/default_page.dart index 3d9459e388aafe8f8677182262a9eab385f79344..021c6097799ba8cf3f0e5ebd5d6800695579abb2 100644 --- a/app/lib/pages/default_page.dart +++ b/app/lib/pages/default_page.dart @@ -64,8 +64,7 @@ class _DefaultPageState extends State<DefaultPage> { if (result != selectedLake) { setState(() { selectedLake = result; - // NB update lastLake persistent variable - //fetchNewLake(context); + initialiseState(false); }); } }), diff --git a/app/lib/server_requests/init_state.dart b/app/lib/server_requests/init_state.dart index 2a873695cfdaf496bb3c4ebb0d9731ccaf04ac6a..b6d2fc036bd8c4eb52937c422455477d42844268 100644 --- a/app/lib/server_requests/init_state.dart +++ b/app/lib/server_requests/init_state.dart @@ -12,7 +12,7 @@ import '../server_requests/fetch_relation.dart'; /// initialiseState makes three requests to the server, one requesting /// measurements for the selected relation, the other requesting the relation, /// and the last requesting the list of all system lakes -Future<void> initialiseState(bool fetchSearchOptions) async { +Future<void> initialiseState(bool initNewLake) async { bool serverConnection = true; late Future<List<Measurement>> markerListFuture; @@ -70,14 +70,14 @@ Future<void> initialiseState(bool fetchSearchOptions) async { relationFuture = loadRelation(); } - if (fetchSearchOptions) { + if (initNewLake) { + // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found + final prefs = await SharedPreferences.getInstance(); + selectedLake = prefs.getString('lastLake') ?? "Mjøsa"; + initSearchOptions(); } - // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found - final prefs = await SharedPreferences.getInstance(); - selectedLake = prefs.getString('lastLake') ?? "Mjøsa"; - // Set the selected relation selectedRelation = await relationFuture; selectedMeasurements = await markerListFuture;