Skip to content

Commit

Permalink
Improve readibility of position string parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Xennis committed Jul 20, 2024
1 parent 23be83f commit e1d54be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions green_walking/lib/pages/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ Position? _stringToPosition(String position) {
return null;
}
try {
// Yes, [1] comes first. We are showing the lat in the beginning.
return Position(double.parse(parts[1]), double.parse(parts[0]));
// String format is: lat,lng
return Position.named(lat: double.parse(parts[0]), lng: double.parse(parts[1]));
} catch (e) {
return null;
}
Expand Down

0 comments on commit e1d54be

Please sign in to comment.