deviceHasFormFactor method
bool
deviceHasFormFactor({
- AFFormFactor? atLeast,
- AFFormFactor? atMost,
- Orientation? withOrientation,
Implementation
bool deviceHasFormFactor({
AFFormFactor? atLeast,
AFFormFactor? atMost,
Orientation? withOrientation
}) {
if(withOrientation != null) {
if(deviceOrientation != withOrientation) {
return false;
}
}
var atLeastIdx = 0;
var atMostIdx = orderedFormFactors.length;
if(atLeast != null) {
atLeastIdx = orderedFormFactors.indexOf(atLeast);
}
if(atMost != null) {
atMostIdx = orderedFormFactors.indexOf(atMost);
}
final actualIdx = orderedFormFactors.indexOf(deviceFormFactor);
return (actualIdx >= atLeastIdx && actualIdx <= atMostIdx);
}