Skip to content

🐛 Bug Report: Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>' #173

Closed
appwrite/sdk-generator
#751

Description

@jtmuller5

👟 Reproduction steps

I see an error when trying to create a new account:

E/flutter (14287): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>'
E/flutter (14287): #0      new User.fromMap (package:appwrite/src/models/user.dart:87:18)
E/flutter (14287): #1      Account.create (package:appwrite/services/account.dart:57:24)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): #2      AppwriteService.createEmailAccount (package:appwrite_auth_ui/src/components/services/appwrite_service.dart:81:19)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): #3      AppwriteSignupState.onSignup (package:appwrite_auth_ui/src/components/screens/signup/signup.dart:29:43)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): 

Apparently the "labels" property is required in the User model but its not returned by the create() method.

👍 Expected behavior

Don't require the labels property on the User model or return the labels list in the create response.

👎 Actual Behavior

An error is thrown

🎲 Appwrite version

Version 2.0.x

💻 Operating system

MacOS

🧱 Your Environment

Basic Flutter app in Android studio. Running on emulator

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. changed the title [-]🐛 Bug Report: [/-] [+]🐛 Bug Report: Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>'[/+] on Sep 10, 2023
  2. stnguyen90 commented on Sep 12, 2023

    @stnguyen90
    Contributor

    @jtmuller5, thanks for creating this issue! 🙏🏼 What version of Appwrite are you on?

  3. self-assigned this
    on Sep 12, 2023
  4. jtmuller5 commented on Sep 12, 2023

    @jtmuller5
    Author

    Hi, I am using version 11.0.0 of the appwrite package on pub dev. I haven't made any other changes to my appwrite setup.

  5. stnguyen90 commented on Sep 12, 2023

    @stnguyen90
    Contributor

    @jtmuller5 Sorry, I meant what version of the Appwrite server?

  6. jtmuller5 commented on Sep 12, 2023

    @jtmuller5
    Author

    It looks like the project is using v 1.1.2. I set it up using the "Get Started" button in Appwrite cloud. Is there a way to upgrade this?

  7. stnguyen90 commented on Sep 12, 2023

    @stnguyen90
    Contributor

    @jtmuller5, Appwrite Cloud is using 1.1.2. The Appwrite team will be upgrading Appwrite Cloud soon.

    The SDK you're attempting to use (11.0.0) is meant for Appwrite 1.4.x, which is why you're getting the error.

    image

    For Appwrite Cloud (on 1.1.2), please try version 8.1.0 of the Appwrite Flutter SDK.

  8. FaisalMohammadi commented on Dec 13, 2023

    @FaisalMohammadi

    i have the same issue when i try to do Query.Select in listDocuments.
    I am using flutter sdk 11.0.1 and my appwrite instance is 1.4.11

  9. Weav3r commented on Dec 13, 2023

    @Weav3r

    Same issue.
    sdk: 11.0.1
    appwrite: 1.4.13

    It works for a single document i.e db.getDocument(...)
    P.S. cli works, rest works and apparently graphql also works

  10. iaggocapitanio1 commented on Dec 27, 2023

    @iaggocapitanio1

    having the same issue, is a problem in the serialization processs, the labels field in the creation is null but it's defines as List .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions