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
From the official package’s changelog, seems like the
Account
model has changed its name intoUser
since version9.0.0
. So you should use it like this instead:According to Appwrite updates, above 9.0.0 version Account has been replaced with User,
you can now use it as;
instead of