computedMaxLinesToDisplay method

int computedMaxLinesToDisplay (BuildContext context)

Returns the maximum lines to display in the rightDataText row based on the ScalePreset chosen by the user. The smaller the ScalePreset chosen the lesser the number of lines displayed and vice-versa. When ScalePreset.minimal is selected '1' line is displayed, '2' lines in case of ScalePreset.small and ScalePreset.normal, '3' in case of ScalePreset.large and '7' in Portrait orientation and '4' in Landscape orientation for ScalePreset.gigantic.

Implementation

int computedMaxLinesToDisplay(BuildContext context) {
  Orientation deviceOrienation = MediaQuery.of(context).orientation;

  switch (_scalePreset) {
    case ScalePreset.minimal:
      return 1;

    case ScalePreset.large:
      return 3;

    case ScalePreset.gigantic:
      return deviceOrienation == Orientation.portrait ? 7 : 4;

    // ScalePreset.normal and ScalePreset.small
    default:
      return 2;
  }
}