Fixed badge
This commit is contained in:
parent
a955ecbfc0
commit
e83f36eb86
4 changed files with 48 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
|||
v2.3.1
|
||||
Fixed badge background when arrival is known but not departure
|
||||
|
||||
v2.3.0
|
||||
Added pull to refresh
|
||||
|
||||
|
|
|
@ -18,11 +18,29 @@ class DisplayTrainStation extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final delay = station.departure?.status?.delay ?? station.arrival?.status?.delay;
|
||||
final real = station.departure?.status?.real ?? station.arrival?.status?.real;
|
||||
final departureStatus = station.departure?.status;
|
||||
final arrivalStatus = station.arrival?.status;
|
||||
int delay;
|
||||
bool real;
|
||||
if (departureStatus == null) {
|
||||
delay = arrivalStatus?.delay ?? 0;
|
||||
real = arrivalStatus?.real ?? false;
|
||||
}
|
||||
else if (arrivalStatus == null) {
|
||||
delay = departureStatus.delay;
|
||||
real = departureStatus.real;
|
||||
}
|
||||
else {
|
||||
delay = departureStatus.delay;
|
||||
real = departureStatus.real;
|
||||
if (!real && arrivalStatus.real) {
|
||||
delay = arrivalStatus.delay;
|
||||
real = arrivalStatus.real;
|
||||
}
|
||||
}
|
||||
|
||||
final isDelayed = delay != null && delay > 0 && real == true;
|
||||
final isOnTime = delay != null && delay <= 0 && real == true;
|
||||
final isDelayed = delay > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return KmBadge(
|
||||
|
|
|
@ -21,11 +21,29 @@ class DisplayTrainStation extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final delay = station.departure?.status?.delay ?? station.arrival?.status?.delay;
|
||||
final real = station.departure?.status?.real ?? station.arrival?.status?.real;
|
||||
final departureStatus = station.departure?.status;
|
||||
final arrivalStatus = station.arrival?.status;
|
||||
int delay;
|
||||
bool real;
|
||||
if (departureStatus == null) {
|
||||
delay = arrivalStatus?.delay ?? 0;
|
||||
real = arrivalStatus?.real ?? false;
|
||||
}
|
||||
else if (arrivalStatus == null) {
|
||||
delay = departureStatus.delay;
|
||||
real = departureStatus.real;
|
||||
}
|
||||
else {
|
||||
delay = departureStatus.delay;
|
||||
real = departureStatus.real;
|
||||
if (!real && arrivalStatus.real) {
|
||||
delay = arrivalStatus.delay;
|
||||
real = arrivalStatus.real;
|
||||
}
|
||||
}
|
||||
|
||||
final isDelayed = delay != null && delay > 0 && real == true;
|
||||
final isOnTime = delay != null && delay <= 0 && real == true;
|
||||
final isDelayed = delay > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return KmBadge(
|
||||
|
|
|
@ -11,7 +11,7 @@ description: O aplicație de vizualizare a datelor puse la dispoziție de Inform
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 2.3.0
|
||||
version: 2.3.1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue