gskinner team

Flutter: Simplify Platform & Screen Size Detection

In the never-ending quest to reduce boilerplate and DRY up our code in Flutter, we have noticed that using the MediaQuery class can be a bit cumbersome, and it’s also missing a couple of key pieces of information.The issues we see are:MediaQuery.of(context) is a bit verbose on its faceChecking for orientation especially is too long: bool isLandscape = MediaQuery.of(context).orientation == Orientation.landscapeThere is no diagonal...