I am facing this error: type 'Null' is not a subtype of type 'int'
- 0
- Self Hosted
- Flutter
- Databases
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in the AreaModel.fromJson constructor, indicating that expected integer fields are receiving null values.
Environment:
Both the SDK and the self-hosted Appwrite server are running on the latest versions.
I encountered the same problem earlier in the day when fetching data from the server, which was resolved by downgrading the Appwrite SDK to version 16.1.0. However, again, this issue has emerged in the functionality related to fetching areas.
Any help would be appreciated!
?
Having the same issue after upgrading to "dart_appwrite: ^16.2.0" seems to be related to missing sequence in json.
factory Document.fromMap(Map<String, dynamic> map) { return Document( $id: map['id'].toString(), $sequence: map['sequence'], <--- $collectionId: map['collectionId'].toString(), $databaseId: map['databaseId'].toString(), $createdAt: map['createdAt'].toString(), $updatedAt: map['updatedAt'].toString(), $permissions: List.from(map['permissions'] ?? []), data: map, ); }
Use appwrite: 17.0.1 the $sequence can return null but the 17.0.2 and over doesn't handle it correctly.
@Maryusz Thanks for the reply
im using the dart only package dart_appwrite since its a dart only package.
I have experienced the same problem. Seems to be fixed by downgrading Flutter Appwrite to 17.0.1
Recommended threads
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Local appwrite run functions --user-id n...
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation. I'm using a self-hosted Appwrite instance and running functions ...
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...