isPortrait method

  1. @protected
bool isPortrait(
  1. BuildContext context,
  2. bool portraitOnly
)

Checks if device is in portrait mode or portrait is enforced

Implementation

@protected
bool isPortrait(BuildContext context, bool portraitOnly) {
  return MediaQuery.of(context).orientation == Orientation.portrait ||
      portraitOnly;
}