Hi All
Flutter appwrite: ^9.0.0
FutureEither<model.Account> signUp({
required String email,
required String password,
});
Can't find Account
The name 'model.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 'model.Account'
But it's in 8.2.0 SDK but not 9
What you're trying to achieve?
@renderlux
Sign up and login
yap, it have been replaced with User
But I'm also asking why Account model is in 8 but not in 9
OK I see
part of appwrite.models;
/// User
class User implements Model {
/// User ID.
final String $id;
/// User creation date in ISO 8601 format.
final String $createdAt;
/// User update date in ISO 8601 format.
final String $updatedAt;
/// User name.
final String name;
/// Hashed user password.
final String? password;
/// Password hashing algorithm.
final String? hash;
/// Password hashing algorithm configuration.
final Map? hashOptions;
/// User registration date in ISO 8601 format.
final String registration;
/// User status. Pass `true` for enabled and `false` for disabled.
final bool status;
/// Password update time in ISO 8601 format.
final String passwordUpdate;
/// User email address.
final String email;
/// User phone number in E.164 format.
final String phone;
/// Email verification status.
final bool emailVerification;
/// Phone verification status.
final bool phoneVerification;
Upgrade SDK to last version
Login is that way:
import { Client, Account } from "appwrite";
const client = new Client();
const account = new Account(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
const promise = account.createEmailSession('email@example.com', 'password');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
And to sign up:
import { Client, Account } from "appwrite";
const client = new Client();
const account = new Account(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
const promise = account.create('[USER_ID]', 'email@example.com', '');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
account.create instead of account.createemailsession
Recommended threads
- Update user email using OTP
Hi, I am trying to implement email update using OTP, there is not password associated with the account. One solution I found online is creating appwrite functio...
- RowList: The value of total is coming as...
RowList: The value of total is coming as a String, so it throws an error because it’s not parsed into an int. Error: TypeError: \"37\": type 'String' is not a ...
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...