From 461dbf411e46e21de01152a64f2c9c57102701b1 Mon Sep 17 00:00:00 2001 From: jt274 <47506129+jt274@users.noreply.github.com> Date: Mon, 2 Jun 2025 10:34:44 -0500 Subject: [PATCH] Add geopolygon to Type enum --- lib/src/models/field.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/src/models/field.dart b/lib/src/models/field.dart index e8c1767..1a1388d 100644 --- a/lib/src/models/field.dart +++ b/lib/src/models/field.dart @@ -250,7 +250,8 @@ class UpdateField extends Field { /// - [Type.stringify] (`string*`) is a way to store the field value (both /// singular and multi-value/array values) as string. /// -/// [Type.geopoint] is used to index locations, filter and sort on them. +/// [Type.geopoint] and [Type.geopolygon] are used to index locations, filter +/// and sort on them. enum Type { string, int32, @@ -260,6 +261,7 @@ enum Type { auto, stringify, geopoint, + geopolygon, object, } @@ -272,6 +274,7 @@ extension _Type on Type { case Type.float: case Type.bool: case Type.geopoint: + case Type.geopolygon: case Type.object: final description = toString(), indexOfDot = description.indexOf('.'), @@ -288,8 +291,10 @@ extension _Type on Type { } static Type fromValue(String value, bool isMultiValued) => - Type.values.firstWhere((type) => value == type.value(isMultiValued), - orElse: () => throw ArgumentError('$value is not a defined Type.')); + Type.values.firstWhere( + (type) => value == type.value(isMultiValued), + orElse: () => throw ArgumentError('$value is not a defined Type.'), + ); } final _multivaluedExpression = RegExp(r'\[\]$');