orientation<T> static method
T
orientation<T>({
- required BuildContext context,
- required dynamic portrait,
- 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;
}
}