When creating a new file using Appwrite Flutter SDK, the file is successfully created on the server, but the client throws the following exception:
type 'Null' is not a subtype of type 'bool'
- Self hosted: 1.8.1
- Flutter SDK: 21.0.0
Althouh i know that this error occured when theris a missmated betwen sdk but for this error i have bothe latest appwrite version 1.8.1 and it flutter lasted sdk 21.0.0 and still facing this
type 'Null' is not a subtype of type 'bool' when creating file
Hey, I'm seeing the same issue when listing files in a bucket:
final list = await context.storage.listFiles(
bucketId: BucketIds.images,
queries: [Query.equal('name', name), Query.limit(1)],
);
This is the relevant stacktrace:
type 'Null' is not a subtype of type 'bool'
#0 new File.fromMap (package:dart_appwrite/src/models/file.dart:73)
#1 new FileList.fromMap.<anonymous closure> (package:dart_appwrite/src/models/file_list.dart:19)
#2 MappedListIterable.elementAt (dart:_internal/iterable.dart:442)
#3 ListIterator.moveNext (dart:_internal/iterable.dart:371)
#4 new List.from (dart:core-patch/array_patch.dart:29)
#5 new FileList.fromMap (package:dart_appwrite/src/models/file_list.dart:19)
#6 Storage.listFiles (package:dart_appwrite/services/storage.dart:161)
- Self hosted: 1.8.1
- dart_appwrite: 21.1.0
Have you found more info, or a workaround?
Looks like the encryption property is missing from the File payload. Tried to disable and re-enable encryption on the bucket settings, without success.
Went step by step, encryption is indeed missing, as well as compression.
Aaaaand I just found this PR: https://github.com/appwrite/appwrite/pull/11135 Looks like the issue is already fixed, we just have to wait for the next Appwrite version to be released.
For reference, the encryption and compression properties were added in dart_appwrite 21.0.0.
Sticking to 20.1.1 resolves the issue until Appwrite 1.8.2 (or above) gets released.
Recommended threads
- Images/Videos in storage appearing broke...
I am running into a storage issue after upgrading my self-hosted Appwrite instance , all of my previously uploaded images and videos are now showing as broken i...
- `project_id_missing` in Cloud Function w...
I've got a cloud function written in `Dart-3.12` that I'm trying to create a file in a file bucket. I'm using the latest `dart_appwrite` sdk (`26.1.0`) and App...
- New OAuth provider not appearing in Cons...
Hi team! I'm contributing to Appwrite and currently working on adding Hugging Face as a new OAuth provider. Here's what I've done so far: - Implemented the ...