mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
15 lines
429 B
Dart
15 lines
429 B
Dart
import 'package:floating/floating.dart';
|
|
|
|
extension RationalExt on Rational {
|
|
/// Checks whether given [Rational] instance fits into Android requirements
|
|
/// or not.
|
|
///
|
|
/// Android docs specified boundaries as inclusive.
|
|
bool get fitsInAndroidRequirements {
|
|
final aspectRatio = numerator / denominator;
|
|
const min = 1 / 2.39;
|
|
const max = 2.39;
|
|
return (min <= aspectRatio) && (aspectRatio <= max);
|
|
}
|
|
}
|