-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 82-graduated-station-speeds
# Conflicts: # das_client/lib/sfera/src/mapper/sfera_model_mapper.dart # das_client/lib/sfera/src/model/network_specific_parameter.dart # das_client/lib/sfera/src/sfera_reply_parser.dart # das_client/test/sfera/mapper/sfera_mapper_test.dart
- Loading branch information
Showing
50 changed files
with
1,339 additions
and
64 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...nt/lib/app/pages/journey/train_journey/widgets/table/balise_level_crossing_group_row.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:das_client/app/i18n/i18n.dart'; | ||
import 'package:das_client/app/pages/journey/train_journey/widgets/table/base_row_builder.dart'; | ||
import 'package:das_client/app/widgets/assets.dart'; | ||
import 'package:das_client/app/widgets/table/das_table_cell.dart'; | ||
import 'package:das_client/model/journey/balise.dart'; | ||
import 'package:das_client/model/journey/balise_level_crossing_group.dart'; | ||
import 'package:das_client/model/journey/level_crossing.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; | ||
|
||
class BaliseLevelCrossingGroupRow extends BaseRowBuilder<BaliseLevelCrossingGroup> { | ||
static const Key baliseIconKey = Key('balise_icon_key'); | ||
|
||
BaliseLevelCrossingGroupRow({ | ||
required super.metadata, | ||
required super.data, | ||
required super.settings, | ||
super.trackEquipmentRenderData, | ||
super.onTap, | ||
}); | ||
|
||
@override | ||
DASTableCell informationCell(BuildContext context) { | ||
if (_baliseCount == 0) { | ||
return DASTableCell( | ||
child: Text('$_levelCrossingCount ${context.l10n.p_train_journey_table_level_crossing}'), | ||
alignment: Alignment.centerLeft, | ||
); | ||
} else if (_baliseCount == 1 && _levelCrossingCount > 1) { | ||
return DASTableCell( | ||
child: Text('($_levelCrossingCount ${context.l10n.p_train_journey_table_level_crossing})'), | ||
alignment: Alignment.centerRight, | ||
); | ||
} else { | ||
return DASTableCell( | ||
child: Row( | ||
children: [ | ||
Text(_levelCrossingCount > 0 ? context.l10n.p_train_journey_table_level_crossing : ''), | ||
Spacer(), | ||
Text(_baliseCount.toString()), | ||
], | ||
), | ||
alignment: Alignment.centerRight, | ||
); | ||
} | ||
} | ||
|
||
@override | ||
DASTableCell iconsCell2(BuildContext context) { | ||
if (_baliseCount > 0) { | ||
return DASTableCell( | ||
padding: EdgeInsets.all(sbbDefaultSpacing * 0.25), | ||
child: SvgPicture.asset( | ||
AppAssets.iconBalise, | ||
key: baliseIconKey, | ||
), | ||
alignment: Alignment.centerLeft, | ||
); | ||
} else { | ||
return DASTableCell.empty(); | ||
} | ||
} | ||
|
||
int get _baliseCount => data.groupedElements.whereType<Balise>().length; | ||
|
||
int get _levelCrossingCount => data.groupedElements.whereType<LevelCrossing>().length; | ||
} |
60 changes: 60 additions & 0 deletions
60
das_client/lib/app/pages/journey/train_journey/widgets/table/balise_row.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:das_client/app/i18n/i18n.dart'; | ||
import 'package:das_client/app/pages/journey/train_journey/widgets/table/base_row_builder.dart'; | ||
import 'package:das_client/app/widgets/assets.dart'; | ||
import 'package:das_client/app/widgets/table/das_table_cell.dart'; | ||
import 'package:das_client/model/journey/balise.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart'; | ||
|
||
class BaliseRow extends BaseRowBuilder<Balise> { | ||
static const Key baliseIconKey = Key('balise_icon_key'); | ||
|
||
BaliseRow({ | ||
required super.metadata, | ||
required super.data, | ||
required super.settings, | ||
super.trackEquipmentRenderData, | ||
super.isGrouped, | ||
}); | ||
|
||
@override | ||
DASTableCell kilometreCell(BuildContext context) { | ||
return isGrouped ? DASTableCell.empty() : super.kilometreCell(context); | ||
} | ||
|
||
@override | ||
DASTableCell timeCell(BuildContext context) { | ||
if (!isGrouped) { | ||
return DASTableCell.empty(); | ||
} | ||
|
||
if (data.kilometre.isEmpty) { | ||
return DASTableCell.empty(color: specialCellColor); | ||
} else { | ||
return DASTableCell(color: specialCellColor, child: Text(data.kilometre[0].toStringAsFixed(3))); | ||
} | ||
} | ||
|
||
@override | ||
DASTableCell informationCell(BuildContext context) { | ||
return DASTableCell( | ||
child: Text(data.amountLevelCrossings > 1 | ||
? '(${data.amountLevelCrossings} ${context.l10n.p_train_journey_table_level_crossing})' | ||
: ''), | ||
alignment: Alignment.centerRight, | ||
); | ||
} | ||
|
||
@override | ||
DASTableCell iconsCell2(BuildContext context) { | ||
return DASTableCell( | ||
padding: EdgeInsets.all(sbbDefaultSpacing * 0.25), | ||
child: SvgPicture.asset( | ||
AppAssets.iconBalise, | ||
key: baliseIconKey, | ||
), | ||
alignment: Alignment.centerLeft, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.