skip to Main Content

I have this error in my code under the <model.account>

THE ERROR :

 The name 'Account' isn't a type, so it can't be used as a type argument.
    Try correcting the name to an existing type, or defining a type named 'Account'. 

THE CODE :

import 'package:appwrite/appwrite.dart';
import 'package:appwrite/models.dart' as model;
import 'package:fpdart/fpdart.dart';
import 'package:appname/core/core.dart';

// want to singup, want to get user account -> Account 
// want to access user related data -> model.Account 

abstract class IAUTHAPI {
 FutureEither<model.Account>signUp({
    required String email,
    required String password,
  });
}

please make sure to read the notes above I have to use model.Account not Account because :

// want to singup, want to get user account -> Account

// want to access user related data -> model.Account

I don’t know you I have this error I am watching video and the person in video did same and donot have any error. thank you for reading if you know what should I do help me !

2

Answers


  1. From the official package’s changelog, seems like the Account model has changed its name into User since version 9.0.0. So you should use it like this instead:

    abstract class IAUTHAPI {
     FutureEither<model.User> signUp({
        required String email,
        required String password,
      });
    }
    
    Login or Signup to reply.
  2. According to Appwrite updates, above 9.0.0 version Account has been replaced with User,

    you can now use it as;

    models.User
    

    instead of

    models.Account
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search