Choose ideal group until selection is implemented
This commit is contained in:
parent
cc7caffffa
commit
f0ccf59db9
3 changed files with 23 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
v2.7.11
|
||||||
|
Add support for IC trains.
|
||||||
|
Allow choosing displayed timezone.
|
||||||
|
Show notes about wagon detachment, receival, or train number changes.
|
||||||
|
Use system accent color if available.
|
||||||
|
Use API v3.
|
||||||
|
|
||||||
v2.7.10
|
v2.7.10
|
||||||
Add about page to Fluent UI.
|
Add about page to Fluent UI.
|
||||||
Add settings page, allowing changing between UIs.
|
Add settings page, allowing changing between UIs.
|
||||||
|
|
|
@ -28,9 +28,21 @@ class TrainData with _$TrainData {
|
||||||
|
|
||||||
factory TrainData.fromJson(Map<String, dynamic> json) => _$TrainDataFromJson(json);
|
factory TrainData.fromJson(Map<String, dynamic> json) => _$TrainDataFromJson(json);
|
||||||
|
|
||||||
List<TrainDataStation> get stations => groups.first.stations;
|
TrainDataGroup get idealGroup {
|
||||||
TrainDataRoute get route => groups.first.route;
|
var result = groups.first;
|
||||||
TrainDataStatus? get status => groups.first.status;
|
|
||||||
|
for (final group in groups) {
|
||||||
|
if (result.stations.map((s) => s.linkName).toSet().difference(group.stations.map((s) => s.linkName).toSet()).isEmpty) {
|
||||||
|
result = group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TrainDataStation> get stations => idealGroup.stations;
|
||||||
|
TrainDataRoute get route => idealGroup.route;
|
||||||
|
TrainDataStatus? get status => idealGroup.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
|
|
@ -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.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 2.7.10
|
version: 2.7.11
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.0.0 <4.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue