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
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...