toSquareMeters method

num toSquareMeters(
  1. AreaUnit unit
)

convert num from unit to square meters

Implementation

num toSquareMeters(AreaUnit unit) {
  switch (unit) {
    case AreaUnit.squareCentimeters:
      return this / 10000;
    case AreaUnit.squareKilometers:
      return this * 1e+6;
    case AreaUnit.squareMiles:
      return this * 2.59e+6;
    case AreaUnit.squareYard:
      return this / 1.196;
    case AreaUnit.squareFoot:
      return this / 10.764;
    case AreaUnit.squareInches:
      return this / 1550;
    case AreaUnit.hectare:
      return this * 10000;
    case AreaUnit.acre:
      return this * 4046.86;
    default:
      return this;
  }
}