Skip to content

Commit

Permalink
chore: fixed UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
rawi-coding committed Nov 28, 2024
1 parent e45884d commit b5e9c8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class BaseRowBuilder<T extends BaseData> extends DASTableRowBuilder {

DASTableCell kilometreCell(BuildContext context) {
if (data.kilometre.isEmpty) {
return DASTableCell.empty();
return DASTableCell.empty(color: specialCellColor);
}

return DASTableCell(
color: getSpecialCellColor(),
color: specialCellColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -62,7 +62,7 @@ class BaseRowBuilder<T extends BaseData> extends DASTableRowBuilder {

DASTableCell routeCell(BuildContext context) {
return DASTableCell(
color: getSpecialCellColor(),
color: specialCellColor,
padding: EdgeInsets.all(0.0),
alignment: null,
child: RouteCellBody(
Expand All @@ -74,7 +74,7 @@ class BaseRowBuilder<T extends BaseData> extends DASTableRowBuilder {
}

DASTableCell timeCell(BuildContext context) {
return DASTableCell.empty();
return DASTableCell.empty(color: specialCellColor);
}

DASTableCell informationCell(BuildContext context) {
Expand Down Expand Up @@ -112,11 +112,8 @@ class BaseRowBuilder<T extends BaseData> extends DASTableRowBuilder {
return DASTableCell.empty();
}

Color? getSpecialCellColor() {
return getAdditionalSpeedRestriction() != null
? AdditionalSpeedRestrictionRow.additionalSpeedRestrictionColor
: null;
}
Color? get specialCellColor =>
getAdditionalSpeedRestriction() != null ? AdditionalSpeedRestrictionRow.additionalSpeedRestrictionColor : null;

AdditionalSpeedRestriction? getAdditionalSpeedRestriction() {
return metadata.additionalSpeedRestrictions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ServicePointRow extends BaseRowBuilder<ServicePoint> {

@override
DASTableCell timeCell(BuildContext context) {
return DASTableCell(child: Text('06:05:52'), alignment: defaultAlignment, color: getSpecialCellColor());
return DASTableCell(child: Text('06:05:52'), alignment: defaultAlignment, color: specialCellColor);
}

@override
Expand Down Expand Up @@ -68,7 +68,7 @@ class ServicePointRow extends BaseRowBuilder<ServicePoint> {
@override
DASTableCell routeCell(BuildContext context) {
return DASTableCell(
color: getSpecialCellColor(),
color: specialCellColor,
padding: EdgeInsets.all(0.0),
alignment: null,
child: RouteCellBody(
Expand Down
2 changes: 1 addition & 1 deletion das_client/lib/app/widgets/table/das_table_cell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DASTableCell {
this.clipBehaviour = Clip.hardEdge,
});

const DASTableCell.empty() : this(child: const SizedBox.shrink());
const DASTableCell.empty({Color? color}) : this(child: const SizedBox.shrink(), color: color);

final BoxBorder? border;
final Widget child;
Expand Down

0 comments on commit b5e9c8e

Please sign in to comment.