INNER CODE UNIT · Dart

booleanValues

Ephenodrom/Dart-Basic-Utils · lib/src/BooleanUtils.dart:61

  static List<bool> booleanValues() {
    return [false, true];
  }

  /// Compares two boolean values
  static int compare(final bool x, final bool y) {
    if (x == y) {
      return 0;
    }
    return x ? 1 : -1;
  }

  /// Converts an int to a boolean using the convention that zero
  /// is false, everything else is true.
  ///
  ///   BooleanUtils.toBoolean(0) = false
  ///   BooleanUtils.toBoolean(1) = true
  ///   BooleanUtils.toBoolean(2) = true

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…