Skip to content
Snippets Groups Projects
Commit f8e9e649 authored by Andri Joos's avatar Andri Joos :blush:
Browse files

make team id optional

parent 8513079b
No related branches found
No related tags found
No related merge requests found
Pipeline #5788 passed with stage
in 45 seconds
......@@ -13,7 +13,7 @@ class Route implements DbModel {
final String? _id;
final List<Point> _points;
final String _userId;
final String _teamId;
final String? _teamId;
@override
String? get id => _id;
......@@ -23,10 +23,10 @@ class Route implements DbModel {
Iterable<Point> get points => _points;
String get userId => _userId;
String get teamId => _teamId;
String? get teamId => _teamId;
Route({String? id, required List<Point> points, required String userId, required String teamId}) :
Route({String? id, required List<Point> points, required String userId, String? teamId}) :
_id = id,
_points = points,
_userId = userId,
......@@ -57,7 +57,7 @@ class Route implements DbModel {
id: getOptionalMapItem(RequestResponseVariables.idFieldName, map),
points: getRequiredMapItem<Iterable>(pointsRequestResponseFieldName, map).map((e) => Point.fromRequest(e)).toList(growable: false),
userId: userId,
teamId: getRequiredMapItem(teamIdRequestResponseFieldName, map),
teamId: getOptionalMapItem(teamIdRequestResponseFieldName, map),
);
}
......@@ -66,7 +66,7 @@ class Route implements DbModel {
id: getOptionalMapItem(DatabaseVariables.idColumnName, map),
points: getRequiredMapItem<Iterable>(pointsDbFieldName, map).map((e) => Point.fromDbData(e)).toList(growable: false),
userId: getRequiredMapItem(userIdDbFieldName, map),
teamId: getRequiredMapItem(teamIdDbFieldName, map),
teamId: getOptionalMapItem(teamIdDbFieldName, map),
);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment