onTapSetTime method

void onTapSetTime()

Implementation

void onTapSetTime() {
  final timeQuery = context.s.timeQuery;
  if(timeQuery == null) {
    return;
  }
  final textVal = context.p.textControllers.textFor(AFUIWidgetID.textTime);
  DateTime revised;
  try {
    revised = DateTime.parse(textVal);
  } on FormatException {
    context.showDialogErrorText(
      themeOrId: t,
      title: "Could not parse time",
      body: "Could not parse the time during DateTime.parse.  Note that days and hours must be two digits (e.g. 05, not 5)",
    );
    return;
  }
  final revisedBase = timeQuery.baseTime.reviseForDesiredNow(DateTime.now(), revised);
  context.executeQuery(AFTimeUpdateListenerQuery(baseTime: revisedBase));

}