You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Flutter中使用Appwrite创建用户时遇List类型不匹配错误

使用Appwrite创建用户时的类型不匹配问题

用户已在Auth模块成功创建,但控制台抛出**“type 'List' is not a subtype of type 'List'”**类型不匹配错误。

代码片段

Future<User> createUser({
    required String email,
    required String password,
    required String name,
  }) async {
    print(email.runtimeType);
    print(password.runtimeType);
    print(name.runtimeType);
    try {
      User user = await account.create(
        userId: ID.unique().toString(),
        email: email.toString(),
        password: password.toString(),
        name: name.toString(),
      );
      print(user);
      return user;
    } on AppwriteException catch (e) {
      Get.snackbar("Error", "Failed to create user: $e",
          colorText: Colors.white);
      rethrow; // Handle the error
    } finally {
      notifyListeners();
    }
  }

错误截图

控制台抛出的类型不匹配错误

已创建用户截图

Auth模块中已成功创建的用户

内容的提问来源于stack exchange,提问作者Suresh Yadav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 07:27:08