Skip to content
Back

`type 'Null' is not a subtype of type 'bool'` when creating file

  • 0
  • 2
  • Self Hosted
  • Flutter
  • Storage
hamed
12 Feb, 2026, 22:31

When creating a new file using Appwrite Flutter SDK, the file is successfully created on the server, but the client throws the following exception:

TypeScript
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

TL;DR
An issue with type conversion is causing an error when creating files. The problem has been fixed in the latest Appwrite version, so updating to 1.8.2 or above will resolve it. Stick to version 20.1.1 until the new release is available. More details in this PR link: https://github.com/appwrite/appwrite/pull/11135.
hamed
12 Feb, 2026, 22:38

type 'Null' is not a subtype of type 'bool' when creating file

17 Feb, 2026, 09:42

Hey, I'm seeing the same issue when listing files in a bucket:

TypeScript
final list = await context.storage.listFiles(
  bucketId: BucketIds.images,
  queries: [Query.equal('name', name), Query.limit(1)],
);

This is the relevant stacktrace:

TypeScript
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?

17 Feb, 2026, 10:58

Looks like the encryption property is missing from the File payload. Tried to disable and re-enable encryption on the bucket settings, without success.

17 Feb, 2026, 11:23

Went step by step, encryption is indeed missing, as well as compression.

17 Feb, 2026, 11:29

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.

17 Feb, 2026, 12:05

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.

2
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more