VectorTileValue constructor

VectorTileValue({
  1. String? stringValue,
  2. double? floatValue,
  3. double? doubleValue,
  4. Int64? intValue,
  5. Int64? uintValue,
  6. Int64? sintValue,
  7. bool? boolValue,
})

Implementation

factory VectorTileValue({
  String? stringValue,
  double? floatValue,
  double? doubleValue,
  Int64? intValue,
  Int64? uintValue,
  Int64? sintValue,
  bool? boolValue,
}) {
  if (stringValue != null) {
    return VectorTileValue.from(ValueType.string, stringValue);
  }
  if (floatValue != null) {
    return VectorTileValue.from(ValueType.float, floatValue);
  }
  if (doubleValue != null) {
    return VectorTileValue.from(ValueType.double, doubleValue);
  }
  if (intValue != null) {
    return VectorTileValue.from(ValueType.int, intValue);
  }
  if (uintValue != null) {
    return VectorTileValue.from(ValueType.uint, uintValue);
  }
  if (sintValue != null) {
    return VectorTileValue.from(ValueType.sint, sintValue);
  }
  if (boolValue != null) {
    return VectorTileValue.from(ValueType.bool, boolValue);
  }
  throw ArgumentError('No value provided');
}