APIPlatformCapability constructor

APIPlatformCapability({
  1. required bool canReadFile,
  2. bool int64 = false,
  3. bool double64 = false,
  4. bool int53 = false,
  5. bool double53 = false,
  6. bool int32 = false,
  7. bool double32 = false,
  8. int? maxSafeInteger,
  9. int? minSafeInteger,
})

Implementation

APIPlatformCapability(
    {required this.canReadFile,
    this.int64 = false,
    this.double64 = false,
    this.int53 = false,
    this.double53 = false,
    this.int32 = false,
    this.double32 = false,
    int? maxSafeInteger,
    int? minSafeInteger})
    : maxSafeInteger = maxSafeInteger ??
          (int64
              ? int64Max.toInt()
              : (int53
                  ? int53Max.toInt()
                  : (int32
                      ? int32Max.toInt()
                      : throw StateError(
                          'maxSafeInteger error: Platform `int` not defined!')))),
      minSafeInteger = minSafeInteger ??
          (int64
              ? int64Min.toInt()
              : (int53
                  ? int53Min.toInt()
                  : (int32
                      ? int32Min.toInt()
                      : throw StateError(
                          'minSafeInteger error: Platform `int` not defined!'))));