apply method

  1. @override
void apply(
  1. Options options
)
override

Adds Authorization: <prefix> <token> to the request options headers.

Initialises the headers map if it has not yet been set, then writes the Authorization key.

Implementation

@override
void apply(Options options) {
  options.headers ??= {};
  options.headers!['Authorization'] = '$prefix $token';
}