Showing
6 changed files
with
23 additions
and
14 deletions
| @@ -26,45 +26,45 @@ extension MDQ on BuildContext { | @@ -26,45 +26,45 @@ extension MDQ on BuildContext { | ||
| 26 | widthTransformer(dividedBy: dividedBy, reducedBy: reducedByW); | 26 | widthTransformer(dividedBy: dividedBy, reducedBy: reducedByW); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | - /// similar to MediaQuery.of(this).padding | 29 | + /// similar to `MediaQuery.of(this).padding`. |
| 30 | EdgeInsets get mediaQueryPadding => MediaQuery.of(this).padding; | 30 | EdgeInsets get mediaQueryPadding => MediaQuery.of(this).padding; |
| 31 | 31 | ||
| 32 | - /// similar to MediaQuery.of(this).viewPadding | 32 | + /// similar to `MediaQuery.of(this).viewPadding`. |
| 33 | EdgeInsets get mediaQueryViewPadding => MediaQuery.of(this).viewPadding; | 33 | EdgeInsets get mediaQueryViewPadding => MediaQuery.of(this).viewPadding; |
| 34 | 34 | ||
| 35 | - /// similar to MediaQuery.of(this).viewInsets; | 35 | + /// similar to `MediaQuery.of(this).viewInsets`. |
| 36 | EdgeInsets get mediaQueryViewInsets => MediaQuery.of(this).viewInsets; | 36 | EdgeInsets get mediaQueryViewInsets => MediaQuery.of(this).viewInsets; |
| 37 | 37 | ||
| 38 | - /// similar to MediaQuery.of(this).orientation; | 38 | + /// similar to `MediaQuery.of(this).orientation`. |
| 39 | Orientation get orientation => MediaQuery.of(this).orientation; | 39 | Orientation get orientation => MediaQuery.of(this).orientation; |
| 40 | 40 | ||
| 41 | - /// check if device is on landscape mode | 41 | + /// check if device is on LANDSCAPE mode. |
| 42 | bool get isLandscape => orientation == Orientation.landscape; | 42 | bool get isLandscape => orientation == Orientation.landscape; |
| 43 | 43 | ||
| 44 | - /// check if device is on portrait mode | 44 | + /// check if device is on PORTRAIT mode. |
| 45 | bool get isPortrait => orientation == Orientation.portrait; | 45 | bool get isPortrait => orientation == Orientation.portrait; |
| 46 | 46 | ||
| 47 | - /// similar to MediaQuery.of(this).devicePixelRatio; | 47 | + /// similar to `MediaQuery.of(this).devicePixelRatio`. |
| 48 | double get devicePixelRatio => MediaQuery.of(this).devicePixelRatio; | 48 | double get devicePixelRatio => MediaQuery.of(this).devicePixelRatio; |
| 49 | 49 | ||
| 50 | - /// similar to MediaQuery.of(this).textScaleFactor; | 50 | + /// similar to `MediaQuery.of(this).textScaleFactor`. |
| 51 | double get textScaleFactor => MediaQuery.of(this).textScaleFactor; | 51 | double get textScaleFactor => MediaQuery.of(this).textScaleFactor; |
| 52 | 52 | ||
| 53 | - /// get the shortestSide from screen | 53 | + /// get the `shortestSide` from screen. |
| 54 | double get mediaQueryShortestSide => mediaQuerySize.shortestSide; | 54 | double get mediaQueryShortestSide => mediaQuerySize.shortestSide; |
| 55 | 55 | ||
| 56 | - /// True if width be larger than 800 | 56 | + /// True if `width` is larger than 800p. |
| 57 | bool get showNavbar => (width > 800); | 57 | bool get showNavbar => (width > 800); |
| 58 | 58 | ||
| 59 | - /// True if the shortestSide is smaller than 600p | 59 | + /// True if the `shortestSide` is smaller than 600p. |
| 60 | bool get isPhone => (mediaQueryShortestSide < 600); | 60 | bool get isPhone => (mediaQueryShortestSide < 600); |
| 61 | 61 | ||
| 62 | - /// True if the shortestSide is largest than 600p | 62 | + /// True if the `shortestSide` is largest than 600p. |
| 63 | bool get isSmallTablet => (mediaQueryShortestSide >= 600); | 63 | bool get isSmallTablet => (mediaQueryShortestSide >= 600); |
| 64 | 64 | ||
| 65 | - /// True if the shortestSide is largest than 720p | 65 | + /// True if the `shortestSide` is largest than 720p. |
| 66 | bool get isLargeTablet => (mediaQueryShortestSide >= 720); | 66 | bool get isLargeTablet => (mediaQueryShortestSide >= 720); |
| 67 | 67 | ||
| 68 | - /// True if the current device is Tablet | 68 | + /// True if the current device is TABLET. |
| 69 | bool get isTablet => isSmallTablet || isLargeTablet; | 69 | bool get isTablet => isSmallTablet || isLargeTablet; |
| 70 | } | 70 | } |
test/src/extensions/num_extensions_test.dart
0 → 100644
-
Please register or login to post a comment