diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-13 20:15:32 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-13 20:15:32 +0200 |
| commit | fe968ef8eed020670abdc8b8554a766eee15e5ed (patch) | |
| tree | 6afef5a1c3605abaa78a8b852b7d836cf5ca8e73 /lib/navigation | |
| parent | d35e4014e16bfdf2e2fc2bde397c385fc53e498c (diff) | |
improvements
Diffstat (limited to 'lib/navigation')
| -rw-r--r-- | lib/navigation/HERENavigation.dart | 1 | ||||
| -rw-r--r-- | lib/navigation/baseNavigation.dart | 61 |
2 files changed, 36 insertions, 26 deletions
diff --git a/lib/navigation/HERENavigation.dart b/lib/navigation/HERENavigation.dart index 0504061..1ccae29 100644 --- a/lib/navigation/HERENavigation.dart +++ b/lib/navigation/HERENavigation.dart @@ -210,7 +210,6 @@ class _HERENavigationState extends BaseNavigationState { if (newVal > 20) newVal = 20; if (newVal < 13) newVal = 13; widget.currentZoom = newVal; - print('hallo' + newVal.toString()); hereMapController.camera.zoomTo(widget.currentZoom); } diff --git a/lib/navigation/baseNavigation.dart b/lib/navigation/baseNavigation.dart index e8f5379..78e5f1c 100644 --- a/lib/navigation/baseNavigation.dart +++ b/lib/navigation/baseNavigation.dart @@ -8,7 +8,7 @@ import '../route.dart' as DHLRoute; import 'package:training_planner/services/iblacklist_provider_service.dart'; class DestinationPin { - final String text; + final int numberOfParcels; final int sequenceNumber; final DHLCoordinates coords; final String? postalcodeNumeric; @@ -18,7 +18,7 @@ class DestinationPin { bool isDoublePlannedAddress; DestinationPin( - {this.text = '', + {required this.numberOfParcels, required this.coords, required this.sequenceNumber, required this.isDoublePlannedAddress, @@ -46,6 +46,10 @@ class ActiveTask { final bool needsSignature; final bool notAtNeighbors; + int getNumberOfPercels() { + return lastParcelNumber - firstParcelNumber + 1; + } + ActiveTask( this.firstParcelNumber, this.deliveryTimeBlock, @@ -120,10 +124,22 @@ abstract class BaseNavigationState extends State<BaseNavigation> { borderRadius: BorderRadius.circular(10), shape: BoxShape.rectangle, ), - child: Text( - pin.sequenceNumber.toString(), - style: TextStyle( - fontSize: 20.0, color: Color.fromARGB(255, 255, 255, 255)), + child: RichText( + text: TextSpan(children: [ + TextSpan( + text: pin.sequenceNumber.toString(), + style: TextStyle( + fontSize: 20.0, + color: Color.fromARGB(255, 255, 255, 255)), + ), + if (pin.numberOfParcels > 1) + TextSpan( + text: ' ' + pin.numberOfParcels.toString(), + style: TextStyle( + fontSize: 12.0, + color: Color.fromARGB(255, 255, 255, 255)), + ) + ]), ), ), Container( @@ -242,25 +258,6 @@ abstract class BaseNavigationState extends State<BaseNavigation> { } } - widget.parcelNumberPins.add( - DestinationPin( - sequenceNumber: int.parse(item.deliverySequenceNumber!), - text: item.deliverySequenceNumber.toString() + - ' = ' + - item.houseNumber! + - (item.houseNumberAddition != null - ? item.houseNumberAddition! - : ''), - coords: DHLCoordinates(destinationGeoCoordinates.lattitude, - destinationGeoCoordinates.longitude), - isDoublePlannedAddress: false, - postalcodeNumeric: item.postalCodeNumeric, - postalcodeAlpha: item.postalCodeAlpha, - houseNumberWithExtra: - item.houseNumber! + (item.houseNumberAddition ?? '')), - ); - widget.destinationCoords.add(destinationGeoCoordinates); - int sequenceNumber = int.parse(item.deliverySequenceNumber!); int groupLastSequenceNumber = int.parse(item.deliverySequenceNumber!); if (item.groupSize != null) { @@ -280,6 +277,20 @@ abstract class BaseNavigationState extends State<BaseNavigation> { item.indicationSignatureRequired == true, item.indicationNotAtNeighbours == true); + widget.parcelNumberPins.add( + DestinationPin( + numberOfParcels: groupedTask.getNumberOfPercels(), + sequenceNumber: int.parse(item.deliverySequenceNumber!), + coords: DHLCoordinates(destinationGeoCoordinates.lattitude, + destinationGeoCoordinates.longitude), + isDoublePlannedAddress: false, + postalcodeNumeric: item.postalCodeNumeric, + postalcodeAlpha: item.postalCodeAlpha, + houseNumberWithExtra: + item.houseNumber! + (item.houseNumberAddition ?? '')), + ); + widget.destinationCoords.add(destinationGeoCoordinates); + if (isFirst) { eventBus.fire(NextStopLoadedEvent(groupedTask)); isFirst = false; |
