get method Null safety

Future<String> get(
  1. dynamic path
)

Implementation

static Future<String> get(path) async {
  String url = '$baseUrl$path';
  try {
    var response = await dio.get(
      url,
      options: Options(
        headers: {'Content-Type': contentType, 'X-XSRF-Protected': 1},
      ),
    );
    Map<String, dynamic> responseData = response.data;
    return prettify(responseData);
  } catch (error) {
    String errorMessage = '*********************** \n'
        'Command failed.  First check if the camera is \n'
        'connected with Wi-Fi.  Try pinging the camera.\n'
        'In access point mode, the camera is always at 192.168.1.1\n'
        'verify that you do not have your home or office router on that same\n'
        'IP address if you have two network interfaces on your computer.\n'
        'details on the execution error are shown below. \n\n'
        '*********************** \n\n';
    errorMessage = errorMessage + error.toString();
    return errorMessage;
  }
}