I have encountered this error with User object previously. when i was working with appwrite functions with Dart.
- When User's preference is empty the User object's preference field is getting initialized as an Empty List instead of Empty Map.
Currently I am working with Client Flutter SDK where I am facing with same issue while accessing Team Object because it has also got Team Preference.
Just want to add , It is working fine if Preference is not empty, just the empty value is creating the issue.
TL;DR
There is a known issue with the Flutter SDK where the preference object is being initialized as an empty list instead of an empty map. This issue has been reported on GitHub. It seems to occur when the preference is empty, causing problems when accessing certain objects like the team object. The problem does not occur when the preference is not empty. Currently, there is no solution provided for this issue.