LCOV - code coverage report
Current view: top level - devices - device_size.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 13 13 100.0 %
Date: 2021-10-18 18:04:10 Functions: 0 0 -

          Line data    Source code
       1             : /// Defines the size of a device
       2             : ///
       3             : /// This is implemented since build_runner does not work with flutter
       4             : /// dependencies. Therefore, Size from flutter material cannot be used.
       5             : class DeviceSize {
       6             :   /// Creates a new instance of DeviceSize by specifying width and height.
       7           9 :   const DeviceSize({
       8             :     required this.width,
       9             :     required this.height,
      10             :   });
      11             : 
      12             :   /// Width of the device
      13             :   final double width;
      14             : 
      15             :   /// Height of the device
      16             :   final double height;
      17             : 
      18             :   /// Multiplication operator.
      19             :   ///
      20             :   /// Returns a [DeviceSize] whose dimensions are the dimensions of the
      21             :   /// left-hand-side operand (a [DeviceSize]) multiplied by the scalar
      22             :   /// right-hand-side operand (a [double]).
      23           2 :   DeviceSize operator *(double operand) => DeviceSize(
      24           2 :         width: width * operand,
      25           2 :         height: height * operand,
      26             :       );
      27             : 
      28             :   /// Division operator.
      29             :   ///
      30             :   /// Returns a [DeviceSize] whose dimensions are the dimensions of the
      31             :   /// left-hand-side operand (a [DeviceSize]) divided by the scalar
      32             :   /// right-hand-side operand (a [double]).
      33           4 :   DeviceSize operator /(double operand) => DeviceSize(
      34           4 :         width: width / operand,
      35           4 :         height: height / operand,
      36             :       );
      37             : 
      38           3 :   @override
      39             :   bool operator ==(Object other) {
      40             :     if (identical(this, other)) return true;
      41             : 
      42           3 :     return other is DeviceSize &&
      43           9 :         other.width == width &&
      44           9 :         other.height == height;
      45             :   }
      46             : 
      47           2 :   @override
      48          10 :   int get hashCode => width.hashCode ^ height.hashCode;
      49             : }

Generated by: LCOV version 1.15