getNewGameHintsCount method Null safety

  1. @Operation('hints', 'count')
Future<Response> getNewGameHintsCount(
  1. @Bind('hints') int hints,
  2. {@Bind('count') int count = 1}
)
@Operation('hints', 'count')

Implementation

@Operation.get('hints', 'count')
Future<Response> getNewGameHintsCount(@Bind.path('hints') int hints,
    {@Bind.path('count') int count = 1}) async {
  if (hints < 17 || hints > 81) {
    return Response.badRequest(body: 'hints must be within [17,81]');
  } else if (count < 1) {
    return Response.badRequest(body: 'count must be positive');
  } else {
    final boards = await getBoards(hints, count);
    return Response.ok({'boards': boards});
  }
}