getHeaders static method

Future<Map<String, String>> getHeaders({
  1. Map<String, String>? customHeaders,
})

Implementation

static Future<Map<String, String>> getHeaders(
    {Map<String, String>? customHeaders}) async {
  String? jwt = await getJwt();
  if (version.isEmpty) {
    var packageInfo = await PackageInfo.fromPlatform();
    version = packageInfo.version;
    buildNumber = packageInfo.buildNumber;
  }
  Map<String, String> headers = {
    'Authorization': 'Bearer $jwt',
    'version-number': version,
    'build-number': buildNumber,
    'platform': platform
  };
  if (customHeaders != null) {
    headers.addAll(customHeaders);
  }
  return headers;
}