1

I'm having a situation with the account.get mapping into my user model for a getUser function

Future<User> getUser() async {
    final res = await account.get();
    return User.fromMap(res.data);
  }

the res.data is error and says getter is not defined

1 Answers1

0

account.get() returns a User object. User has the following properties:

final String $id;
/// User creation date in Unix timestamp.
final int $createdAt;
/// User update date in Unix timestamp.
final int $updatedAt;
/// User name.
final String name;
/// User registration date in Unix timestamp.
final int registration;
/// User status. Pass `true` for enabled and `false` for disabled.
final bool status;
/// Unix timestamp of the most recent password update
final int 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;
/// User preferences as a key-value object
final Preferences prefs;

As you can see, there is no data property. Refer to the source code for User for more info.

Steven Nguyen
  • 452
  • 4
  • 4