defineInitialTime method

void defineInitialTime(
  1. Object timeOrId
)

Implementation

void defineInitialTime(Object timeOrId) {
  final time = definitions.td(timeOrId);
  test.defineQueryResponseDynamic(AFUIQueryID.time,  (context, q) {
    if(time is AFTimeState) {
      context.onSuccess(time);
    } else {
      assert(time is DateTime);
      context.onSuccess(AFTimeState(
        actualNow: time,
        timeZone: AFTimeZone.local,
        pauseTime: null,
        simulatedOffset: const Duration(milliseconds: 0),
        pushUpdateFrequency: const Duration(minutes: 1000),
        pushUpdateSpecificity: AFTimeStateUpdateSpecificity.minute
      ));
    }
  });
}