User class

User.

Annotations
  • @immutable
  • @MappableClass()

Constructors

User({required int id, required String username, required String slug, required String avatarFilename, required bool superuser, required bool staff})
Creates user.
const

Properties

avatarFilename String
User's avatar file name.
final
hashCode int
The hash code for this object.
no setterinherited
id int
User ID.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slug String
Human-readable unique user identifier.
final
staff bool
Whether user is staff member.
final
superuser bool
Whether user is superuser.
final
username String
User name.
final

Methods

getAvatarUrl({API? api, Hosts? hosts}) Uri
Returns avatar url using hosts settings from api client or provided hosts config.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
inherited
toMap() Map<String, dynamic>
inherited
toString() String
Returns username.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

parse User Function(dynamic value)
Parses User instance from a given value.
no setter
parseJson User Function(String json)
Parses JSON string into User similarly to parse.
no setter
parseJsonList List<User> Function(String json)
Parses JSON string into List of User instances similarly to parseList.
no setter
parseList List<User> Function(dynamic value)
Parses List of User instances from a given value.
no setter