getOptions method

Options getOptions({
  1. required bool protected,
})

Implementation

Options getOptions({required bool protected}) {
  Map<String, dynamic> headers = {
    'Accept-Language': acceptLanguage,
  };
  Options options = Options(headers: headers);
  if (!protected || _access == null) {
    return options;
  }

  headers.addAll({
    'Authorization': 'Bearer $_access',
  });
  return options.copyWith(headers: headers);
}