MultiScreenLayoutInfoModel constructor

MultiScreenLayoutInfoModel({
  1. required PlatformDisplayFeature platformDisplayFeature,
  2. required SurfaceDuoInfoModel surfaceDuoInfoModel,
})

Implementation

MultiScreenLayoutInfoModel({
  required this.platformDisplayFeature,
  required this.surfaceDuoInfoModel,
}) {
  FoldDirection foldDirection;
  if (platformDisplayFeature.bounds.top == 0 ||
      platformDisplayFeature.bounds.bottom == 0) {
    foldDirection = FoldDirection.horizontal;
  } else if (platformDisplayFeature.bounds.left == 0 ||
      platformDisplayFeature.bounds.right == 0) {
    foldDirection = FoldDirection.vertical;
  } else {
    foldDirection = FoldDirection.none;
  }

  this.foldingState = foldingStateFromString(platformDisplayFeature.state);
  this.foldDirection = foldDirection;
}