Skip to content

Commit

Permalink
#230 - replace decimal numbers with integers at parking's page - make…
Browse files Browse the repository at this point in the history
… sure that free parking's slots're always => 0
  • Loading branch information
mikolaj-jalocha committed Sep 25, 2024
1 parent f768d7d commit 25cd3c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/features/parkings_view/models/parking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Parking with _$Parking implements GoogleNavigable {
return ParkingsConfig.rootUrl + photo.trim();
}

String get parsedNumberOfPlaces => numberOfPlaces.startsWith("-") ? "0" : numberOfPlaces;

double get latitude => double.tryParse(geoLat) ?? 0;
double get longitude => double.tryParse(geoLan) ?? 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class _RightColumn extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
parking.numberOfPlaces,
parking.parsedNumberOfPlaces,
style: isActive
? context.iParkingTheme.title.withoutShadows
: context.iParkingTheme.title,
Expand Down

0 comments on commit 25cd3c9

Please sign in to comment.