copyWith method

PublicTransportInfo copyWith({
  1. PublicTransportType? type,
  2. List<String>? names,
  3. List<int>? suggestedCarNumbers,
  4. String? boardingSuggest,
  5. Optional<int?>? color,
})

Implementation

PublicTransportInfo copyWith({
  PublicTransportType? type,
  List<String>? names,
  List<int>? suggestedCarNumbers,
  String? boardingSuggest,
  Optional<int?>? color,
  String? routeLogo
}) {
  return PublicTransportInfo(
    type: type ?? this.type,
    names: names ?? this.names,
    suggestedCarNumbers: suggestedCarNumbers ?? this.suggestedCarNumbers,
    boardingSuggest: boardingSuggest ?? this.boardingSuggest,
    color: color != null ? color.value : this.color,
    routeLogo: routeLogo ?? this.routeLogo
  );
}