buildRightTickerText function

String buildRightTickerText(
  1. ClockModel model
)

buildRightTickerText String is decided based on the rules above

Implementation

String buildRightTickerText(ClockModel model) {
  final phase = (spaceClockTime.second / kDelayS).round() % kPhases;
  String currentPart;
  if (phase == 0) {
    currentPart = "NOW ${model.temperatureString}";
  } else if (phase == 1) {
    currentPart = "LOW ${model.lowString}";
  } else if (phase == 2) {
    currentPart = "HIGH ${model.highString}";
  } else if (phase == 3 && model.location is String) {
    currentPart = model.location;
  } else {
    currentPart = date;
  }

  return "$currentPart";
}