Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
<img src="https://github.com/ActivitySpaceProject/space_mapper/blob/master/Assets/images/3.0.2%2B18_screenshots.png" width="95%"></img>
Expand Down
16 changes: 8 additions & 8 deletions Space_Mapper/lib/models/list_view.dart
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
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;

import '../app_localizations.dart';

class CustomLocationsManager {
static List<CustomLocation> customLocations = [];
//static List<CustomLocation> customLocations = [];

static List<CustomLocation> fetchAll({required bool sortByNewest}) {
/*static List<CustomLocation> 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) {
Expand Down
33 changes: 32 additions & 1 deletion Space_Mapper/lib/ui/list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,38 @@ class _STOListViewState extends State<STOListView> {
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;
},*/
);
});
},
));
Expand Down
12 changes: 6 additions & 6 deletions Space_Mapper/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Space_Mapper/test/unit/list_view_test.dart
Original file line number Diff line number Diff line change
@@ -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', () {
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -150,6 +150,6 @@ void main() {
}
}
});
});
});*/
});
}