Header.basicAuth constructor
Implementation
factory Header.basicAuth({
required String username,
required String password,
Encoding encoding = utf8,
}) {
final bytes = encoding.encode('$username:$password');
final encoded = base64.encode(bytes);
return Header(
name: 'Authorization',
value: 'Basic $encoded',
);
}