=William Cunha Cardoso
Committed by Nipodemos

create test files + update test on double

@@ -51,45 +51,45 @@ extension MDQ on BuildContext { @@ -51,45 +51,45 @@ extension MDQ on BuildContext {
51 widthTransformer(dividedBy: dividedBy, reducedBy: reducedByW); 51 widthTransformer(dividedBy: dividedBy, reducedBy: reducedByW);
52 } 52 }
53 53
54 - /// similar to [MediaQuery.of(context).padding] 54 + /// similar to `MediaQuery.of(this).padding`.
55 EdgeInsets get mediaQueryPadding => MediaQuery.of(this).padding; 55 EdgeInsets get mediaQueryPadding => MediaQuery.of(this).padding;
56 56
57 - /// similar to [MediaQuery.of(context).viewPadding] 57 + /// similar to `MediaQuery.of(this).viewPadding`.
58 EdgeInsets get mediaQueryViewPadding => MediaQuery.of(this).viewPadding; 58 EdgeInsets get mediaQueryViewPadding => MediaQuery.of(this).viewPadding;
59 59
60 - /// similar to [MediaQuery.of(context).viewInsets] 60 + /// similar to `MediaQuery.of(this).viewInsets`.
61 EdgeInsets get mediaQueryViewInsets => MediaQuery.of(this).viewInsets; 61 EdgeInsets get mediaQueryViewInsets => MediaQuery.of(this).viewInsets;
62 62
63 - /// similar to [MediaQuery.of(context).orientation] 63 + /// similar to `MediaQuery.of(this).orientation`.
64 Orientation get orientation => MediaQuery.of(this).orientation; 64 Orientation get orientation => MediaQuery.of(this).orientation;
65 65
66 - /// check if device is on landscape mode 66 + /// check if device is on LANDSCAPE mode.
67 bool get isLandscape => orientation == Orientation.landscape; 67 bool get isLandscape => orientation == Orientation.landscape;
68 68
69 - /// check if device is on portrait mode 69 + /// check if device is on PORTRAIT mode.
70 bool get isPortrait => orientation == Orientation.portrait; 70 bool get isPortrait => orientation == Orientation.portrait;
71 71
72 - /// similar to [MediaQuery.of(this).devicePixelRatio] 72 + /// similar to `MediaQuery.of(this).devicePixelRatio`.
73 double get devicePixelRatio => MediaQuery.of(this).devicePixelRatio; 73 double get devicePixelRatio => MediaQuery.of(this).devicePixelRatio;
74 74
75 - /// similar to [MediaQuery.of(this).textScaleFactor] 75 + /// similar to `MediaQuery.of(this).textScaleFactor`.
76 double get textScaleFactor => MediaQuery.of(this).textScaleFactor; 76 double get textScaleFactor => MediaQuery.of(this).textScaleFactor;
77 77
78 - /// get the shortestSide from screen 78 + /// get the `shortestSide` from screen.
79 double get mediaQueryShortestSide => mediaQuerySize.shortestSide; 79 double get mediaQueryShortestSide => mediaQuerySize.shortestSide;
80 80
81 - /// True if width be larger than 800 81 + /// True if `width` is larger than 800p.
82 bool get showNavbar => (width > 800); 82 bool get showNavbar => (width > 800);
83 83
84 - /// True if the shortestSide is smaller than 600p 84 + /// True if the `shortestSide` is smaller than 600p.
85 bool get isPhone => (mediaQueryShortestSide < 600); 85 bool get isPhone => (mediaQueryShortestSide < 600);
86 86
87 - /// True if the shortestSide is largest than 600p 87 + /// True if the `shortestSide` is largest than 600p.
88 bool get isSmallTablet => (mediaQueryShortestSide >= 600); 88 bool get isSmallTablet => (mediaQueryShortestSide >= 600);
89 89
90 - /// True if the shortestSide is largest than 720p 90 + /// True if the `shortestSide` is largest than 720p.
91 bool get isLargeTablet => (mediaQueryShortestSide >= 720); 91 bool get isLargeTablet => (mediaQueryShortestSide >= 720);
92 92
93 - /// True if the current device is Tablet 93 + /// True if the current device is TABLET.
94 bool get isTablet => isSmallTablet || isLargeTablet; 94 bool get isTablet => isSmallTablet || isLargeTablet;
95 } 95 }
  1 +import 'package:flutter_test/flutter_test.dart';
  2 +import 'package:get/utils.dart';
  3 +
  4 +void main() {
  5 + test('Test for toPrecision on Double', () {
  6 + double testVar = 5.4545454;
  7 + expect(testVar.toPrecision(2), equals(5.45));
  8 + });
  9 +}