diff --git a/README.md b/README.md
index 4e94b0a9..14abff71 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# **Space Mapper**
## What is Space Mapper?
-Space Mapper is a mobile phone application that lets you see your daily movements in a map. Additionally, you can participate in citizen science by sharing your anonymized location history with research institutions to help scientists research about human mobility.
+Space Mapper is a privacy-focused mobile phone application that lets you see your daily movements in a map. Additionally, you can optionally participate in citizen science by sharing your anonymized location history with research institutions to help scientists research about human mobility.
## Screenshots
diff --git a/Space_Mapper/lib/models/list_view.dart b/Space_Mapper/lib/models/list_view.dart
index c409cd4f..cfa9939a 100644
--- a/Space_Mapper/lib/models/list_view.dart
+++ b/Space_Mapper/lib/models/list_view.dart
@@ -1,4 +1,4 @@
-import 'package:collection/collection.dart';
+//import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart'
as bg;
@@ -6,27 +6,27 @@ import 'package:flutter_background_geolocation/flutter_background_geolocation.da
import '../app_localizations.dart';
class CustomLocationsManager {
- static List customLocations = [];
+ //static List customLocations = [];
- static List fetchAll({required bool sortByNewest}) {
+ /*static List fetchAll({required bool sortByNewest}) {
if (sortByNewest) {
return customLocations;
} else {
return new List.from(customLocations.reversed);
}
- }
+ }*/
- static CustomLocation? fetchByUUID(String uuid) {
+ /*static CustomLocation? fetchByUUID(String uuid) {
CustomLocation? ret = customLocations
.firstWhereOrNull((element) => element.getUUID() == uuid);
return ret;
- }
+ }*/
- static void removeAllCustomLocations() {
+ /*static void removeAllCustomLocations() {
print("Removing " + customLocations.length.toString() + " customLocations");
customLocations.clear();
print("All customLocations removed");
- }
+ }*/
/// Makes timestamp readable by a human
static String formatTimestamp(String timestamp) {
diff --git a/Space_Mapper/lib/ui/list_view.dart b/Space_Mapper/lib/ui/list_view.dart
index b60e2ef5..85b4ad97 100644
--- a/Space_Mapper/lib/ui/list_view.dart
+++ b/Space_Mapper/lib/ui/list_view.dart
@@ -121,7 +121,38 @@ class _STOListViewState extends State {
itemCount: snapshot.data!.length,
itemBuilder: (context, index) {
CustomLocation thisLocation = snapshot.data![index];
- return _tile(thisLocation, context);
+ return Dismissible(
+ child: _tile(thisLocation, context),
+ background: Container(
+ child: Container(
+ margin: EdgeInsets.only(right: 10.0),
+ alignment: Alignment.centerRight,
+ child:
+ new LayoutBuilder(builder: (context, constraint) {
+ return new Icon(Icons.delete_forever,
+ size: constraint.biggest.height * 0.5);
+ }),
+ ),
+ color: Colors.red,
+ ),
+ key: new UniqueKey(),
+ direction: DismissDirection.endToStart,
+ onDismissed: (direction) async => {
+ await thisLocation.deleteThisLocation(),
+ ScaffoldMessenger.of(context).showSnackBar(
+ new SnackBar(content: new Text("Location removed")))
+ },
+ /*confirmDismiss: (DismissDirection direction) async {
+ //if(direction == DismissDirection.)
+ // if (direction == left)
+ await thisLocation.deleteThisLocation();
+ setState(() {
+ //recalculateLocations();
+ //thisLocation = snapshot.data![index];
+ });
+ return true;
+ },*/
+ );
});
},
));
diff --git a/Space_Mapper/pubspec.lock b/Space_Mapper/pubspec.lock
index 0c419038..cd4d9b1e 100644
--- a/Space_Mapper/pubspec.lock
+++ b/Space_Mapper/pubspec.lock
@@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.8.1"
+ version: "2.8.2"
background_fetch:
dependency: "direct main"
description:
@@ -70,7 +70,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "1.2.0"
charcode:
dependency: transitive
description:
@@ -328,7 +328,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
- version: "0.12.10"
+ version: "0.12.11"
meta:
dependency: transitive
description:
@@ -648,21 +648,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
- version: "1.17.10"
+ version: "1.17.12"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.2"
+ version: "0.4.3"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.0"
+ version: "0.4.2"
transparent_image:
dependency: transitive
description:
diff --git a/Space_Mapper/test/unit/list_view_test.dart b/Space_Mapper/test/unit/list_view_test.dart
index e800d7c6..6fca3138 100644
--- a/Space_Mapper/test/unit/list_view_test.dart
+++ b/Space_Mapper/test/unit/list_view_test.dart
@@ -1,6 +1,6 @@
import 'package:asm/models/list_view.dart';
import 'package:test/test.dart';
-import 'package:faker/faker.dart';
+//import 'package:faker/faker.dart';
void main() {
group('Locations History Screen - Unit Tests', () {
@@ -94,7 +94,7 @@ void main() {
});
});*/
});
- group("CustomLocationsManager class", () {
+ /*group("CustomLocationsManager class", () {
test("fetchAll and fetchByUUID", () async {
//We create 50 fake locations to do the test
for (int i = 0; i < 50; i++) {
@@ -150,6 +150,6 @@ void main() {
}
}
});
- });
+ });*/
});
}