getInfoModel static method

Gets all relevant multi screen information in one call to the platform

Implementation

static Future<MultiScreenLayoutInfoModel> getInfoModel() async {
  if (!_isAndroid) return MultiScreenLayoutInfoModel.unknown();
  final result = await _methodChannel.invokeMethod<String>('getInfoModel');
  if (result == null) {
    return MultiScreenLayoutInfoModel.unknown();
  } else {
    var infoModel = PlatformInfoModel.fromJson(jsonDecode(result));
    return MultiScreenLayoutInfoModel.fromPlatform(infoModel);
  }
}