Skip to content

Commit 3aec5b4

Browse files
authored
Merge pull request #147 from jt274/master
Add geopolygon to Type enum
2 parents ac360fc + 461dbf4 commit 3aec5b4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/src/models/field.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ class UpdateField extends Field {
250250
/// - [Type.stringify] (`string*`) is a way to store the field value (both
251251
/// singular and multi-value/array values) as string.
252252
///
253-
/// [Type.geopoint] is used to index locations, filter and sort on them.
253+
/// [Type.geopoint] and [Type.geopolygon] are used to index locations, filter
254+
/// and sort on them.
254255
enum Type {
255256
string,
256257
int32,
@@ -260,6 +261,7 @@ enum Type {
260261
auto,
261262
stringify,
262263
geopoint,
264+
geopolygon,
263265
object,
264266
}
265267

@@ -272,6 +274,7 @@ extension _Type on Type {
272274
case Type.float:
273275
case Type.bool:
274276
case Type.geopoint:
277+
case Type.geopolygon:
275278
case Type.object:
276279
final description = toString(),
277280
indexOfDot = description.indexOf('.'),
@@ -288,8 +291,10 @@ extension _Type on Type {
288291
}
289292

290293
static Type fromValue(String value, bool isMultiValued) =>
291-
Type.values.firstWhere((type) => value == type.value(isMultiValued),
292-
orElse: () => throw ArgumentError('$value is not a defined Type.'));
294+
Type.values.firstWhere(
295+
(type) => value == type.value(isMultiValued),
296+
orElse: () => throw ArgumentError('$value is not a defined Type.'),
297+
);
293298
}
294299

295300
final _multivaluedExpression = RegExp(r'\[\]$');

0 commit comments

Comments
 (0)