orientation<T> static method

T orientation<T>({
  1. required BuildContext context,
  2. required dynamic portrait,
  3. required dynamic landscape,
})

Allow us to set a property based on the orientation

Implementation

static T orientation<T>({
  required BuildContext context,
  required portrait,
  required landscape,
}) {
  if (context.isPortrait) {
    return portrait;
  } else if (context.isLandscape) {
    return landscape;
  } else {
    return portrait;
  }
}