hello method

  1. @Operation()
Future<Response> hello()

Implementation

@Operation.get()
Future<Response> hello() async {
  final now = DateTime.now().toLocal();
  final year = now.year;
  final month = getMonth(now.month);
  final day = now.day.toString().padLeft(2, '0');
  final weekday = getWeekday(now.weekday);
  final ending = now.hour > 11 ? 'pm' : 'am';
  final hour = getHour(now.hour).toString().padLeft(2, '0');
  final minute = now.minute.toString().padLeft(2, '0');
  final second = now.second.toString().padLeft(2, '0');
  return Response.ok(
      'Hello I am api_dartdoku and it is currently $weekday, $day $month $year at $hour:$minute:$second $ending.');
}