list method Null safety

Future<Tasks> list(
  1. String tasklist,
  2. {String? completedMax,
  3. String? completedMin,
  4. String? dueMax,
  5. String? dueMin,
  6. int? maxResults,
  7. String? pageToken,
  8. bool? showCompleted,
  9. bool? showDeleted,
  10. bool? showHidden,
  11. String? updatedMin,
  12. String? $fields}
)

Returns all tasks in the specified task list.

Request parameters:

tasklist - Task list identifier.

completedMax - Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.

completedMin - Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.

dueMax - Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.

dueMin - Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.

maxResults - Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100).

pageToken - Token specifying the result page to return. Optional.

showCompleted - Flag indicating whether completed tasks are returned in the result. Optional. The default is True. Note that showHidden must also be True to show tasks completed in first party clients, such as the web UI and Google's mobile apps.

showDeleted - Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.

showHidden - Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.

updatedMin - Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Tasks.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Tasks> list(
  core.String tasklist, {
  core.String? completedMax,
  core.String? completedMin,
  core.String? dueMax,
  core.String? dueMin,
  core.int? maxResults,
  core.String? pageToken,
  core.bool? showCompleted,
  core.bool? showDeleted,
  core.bool? showHidden,
  core.String? updatedMin,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (completedMax != null) 'completedMax': [completedMax],
    if (completedMin != null) 'completedMin': [completedMin],
    if (dueMax != null) 'dueMax': [dueMax],
    if (dueMin != null) 'dueMin': [dueMin],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (showCompleted != null) 'showCompleted': ['${showCompleted}'],
    if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
    if (showHidden != null) 'showHidden': ['${showHidden}'],
    if (updatedMin != null) 'updatedMin': [updatedMin],
    if ($fields != null) 'fields': [$fields],
  };

  final _url =
      'tasks/v1/lists/' + commons.escapeVariable('$tasklist') + '/tasks';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return Tasks.fromJson(_response as core.Map<core.String, core.dynamic>);
}