Fix alignment of station names in train screen
This commit is contained in:
parent
9436b7964a
commit
bf0078f2e9
4 changed files with 104 additions and 85 deletions
|
@ -1,3 +1,6 @@
|
|||
v2.7.2
|
||||
Fixed alignment of station names in train screen.
|
||||
|
||||
v2.7.1
|
||||
Switched train suggestions list from hardcoded data to server data.
|
||||
Added Linux build files.
|
||||
|
|
|
@ -16,51 +16,58 @@ class DisplayTrainStation extends StatelessWidget {
|
|||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Builder(
|
||||
builder: (context) {
|
||||
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 > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return Badge(
|
||||
text: station.km.toString(),
|
||||
caption: 'km',
|
||||
isNotScheduled: isNotScheduled,
|
||||
isDelayed: isDelayed,
|
||||
isOnTime: isOnTime,
|
||||
);
|
||||
}
|
||||
),
|
||||
Expanded(
|
||||
child: Title(
|
||||
station: station,
|
||||
flex: 1,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
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 > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return Badge(
|
||||
text: station.km.toString(),
|
||||
caption: 'km',
|
||||
isNotScheduled: isNotScheduled,
|
||||
isDelayed: isDelayed,
|
||||
isOnTime: isOnTime,
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
),
|
||||
Title(
|
||||
station: station,
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: station.platform == null ? Container() : Badge(text: station.platform!, caption: 'linia'),
|
||||
),
|
||||
),
|
||||
if (station.platform == null)
|
||||
Container(width: 48, height: 48,)
|
||||
else
|
||||
Badge(text: station.platform!, caption: 'linia'),
|
||||
],
|
||||
),
|
||||
Time(
|
||||
|
|
|
@ -19,51 +19,60 @@ class DisplayTrainStation extends StatelessWidget {
|
|||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Builder(
|
||||
builder: (context) {
|
||||
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 > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return Badge(
|
||||
text: station.km.toString(),
|
||||
caption: 'km',
|
||||
isNotScheduled: isNotScheduled,
|
||||
isDelayed: isDelayed,
|
||||
isOnTime: isOnTime,
|
||||
);
|
||||
}
|
||||
),
|
||||
Expanded(
|
||||
child: Title(
|
||||
station: station,
|
||||
flex: 1,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
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 > 0 && real == true;
|
||||
final isOnTime = delay <= 0 && real == true;
|
||||
final isNotScheduled = false;
|
||||
|
||||
return Badge(
|
||||
text: station.km.toString(),
|
||||
caption: 'km',
|
||||
isNotScheduled: isNotScheduled,
|
||||
isDelayed: isDelayed,
|
||||
isOnTime: isOnTime,
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
),
|
||||
if (station.platform == null)
|
||||
Container(width: isSmallScreen(context) ? 42 : 48, height: isSmallScreen(context) ? 42 : 48,)
|
||||
else
|
||||
Badge(text: station.platform!, caption: 'linia',),
|
||||
Title(
|
||||
station: station,
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: (station.platform == null)
|
||||
? Container()
|
||||
: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Badge(text: station.platform!, caption: 'linia',),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Time(
|
||||
|
|
|
@ -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.7.1
|
||||
version: 2.7.2
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue