addBasicAuthenticationHeader function
In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic
Implementation
Map<String, String> addBasicAuthenticationHeader(
Map<String, String> headers, String username, String password) {
headers['authorization'] =
'Basic ' + base64.encode(utf8.encode('$username:$password'));
return headers;
}