From 548138abedd2fa39d1ed60f151f6f0907876e3ee Mon Sep 17 00:00:00 2001 From: sadji Date: Sun, 10 Aug 2025 15:18:57 +0100 Subject: [PATCH] fix(models): tolerate `$sequence` int/string/null in Document.fromMap --- lib/src/models/document.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/models/document.dart b/lib/src/models/document.dart index cf85e45..d83d49f 100644 --- a/lib/src/models/document.dart +++ b/lib/src/models/document.dart @@ -6,7 +6,7 @@ class Document implements Model { final String $id; /// Document automatically incrementing ID. - final int $sequence; + final int? $sequence; /// Collection ID. final String $collectionId; @@ -39,7 +39,7 @@ class Document implements Model { factory Document.fromMap(Map map) { return Document( $id: map['\$id'].toString(), - $sequence: map['\$sequence'], + $sequence: (map['\$sequence'] as num?)?.toInt(), $collectionId: map['\$collectionId'].toString(), $databaseId: map['\$databaseId'].toString(), $createdAt: map['\$createdAt'].toString(),