User class
User model
Constructors
-
User({required String id, required String email, String? name, List<
String> roles = const ['user'], bool emailVerified = false, DateTime? createdAt, DateTime? updatedAt, Map<String, dynamic> ? metadata}) -
Creates a new User instance
const
-
User.fromJson(Map<
String, dynamic> json) -
Creates from JSON
factory
Properties
- createdAt → DateTime?
-
Creation timestamp
final
- email → String
-
Email address
final
- emailVerified → bool
-
Whether email is verified
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
User ID
final
-
metadata
→ Map<
String, dynamic> ? -
Additional metadata
final
- name → String?
-
Display name
final
-
roles
→ List<
String> -
User roles
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- updatedAt → DateTime?
-
Last update timestamp
final
Methods
-
copyWith(
{String? id, String? email, String? name, List< String> ? roles, bool? emailVerified, DateTime? createdAt, DateTime? updatedAt, Map<String, dynamic> ? metadata}) → User - Creates a copy with updated fields
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited