orientationValue<T> method

T orientationValue<T>({
  1. required T portrait,
  2. required T landscape,
})

Gets a value based on the current orientation.

final columns = context.orientationValue<int>(
  portrait: 2,
  landscape: 4,
);

Implementation

T orientationValue<T>({required T portrait, required T landscape}) {
  return isPortrait ? portrait : landscape;
}