applyToParams method

  1. @override
void applyToParams(
  1. List<MmQueryParam> queryParams,
  2. Map<String, String> headerParams
)
override

Apply authentication settings to header and query params.

Implementation

@override
void applyToParams(List<MmQueryParam> queryParams, Map<String, String> headerParams) {
  if (username.isNotEmpty && password.isNotEmpty) {
    final credentials = '$username:$password';
    headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
  }
}