buildInfo method Null safety

Future<BuildInfoResponse> buildInfo()

Implementation

static Future<BuildInfoResponse> buildInfo() async {
  String  buildDate = await _channel.invokeMethod('buildDate');
  String  buildDateWithTime = await _channel.invokeMethod('buildDateWithTime');
  String  versionName = await _channel.invokeMethod('versionName');
  String  versionCode = await _channel.invokeMethod('versionCode');
  String  packageName = await _channel.invokeMethod('packageName');
  String  appName = await _channel.invokeMethod('appName');


  return BuildInfoResponse(
      buildDate : buildDate == "null"  || buildDate == "error" ? "" : buildDate,
      buildDateWithTime : buildDateWithTime == "null"  || buildDateWithTime == "error" ? "" : buildDateWithTime,
      versionNumber : versionName == "null"  || versionName == "error" ? "" : versionName,
      buildNumber : versionCode == "null"  || versionCode == "error" ? "" : versionCode,
      packageName : packageName == "null"  || packageName == "error" ? "" : packageName,
      appName : appName == "null"  || appName == "error" ? "" : appName
  );
}