SentryUser class
Describes the current user associated with the application, such as the currently signed in user.
The user can be specified globally in the Scope.user field, or per event in the SentryEvent.user field.
You should provide at least one of id, email, ipAddress, username for Sentry to be able to tell you how many users are affected by one issue, for example. Sending a user that has none of these attributes and only custom attributes is valid, but not as useful.
Conforms to the User Interface contract for Sentry https://develop.sentry.dev/sdk/event-payloads/user/
The outgoing JSON representation is:
"user": {
"id": "unique_id",
"username": "my_user",
"email": "foo@example.com",
"ip_address": "127.0.0.1",
}
Constructors
-
SentryUser.new({String? id, String? username, String? email, String? ipAddress, SentryGeo? geo, String? name, Map<
String, dynamic> ? data, @Deprecated('Will be removed in v8. Use [data] instead') Map<String, dynamic> ? extras, Map<String, dynamic> ? unknown}) -
You should provide at least one of
id
,email
,ipAddress
,username
for Sentry to be able to tell you how many users are affected by one issue, for example. Sending a user that has none of these attributes and only custom attributes is valid, but not as useful. -
SentryUser.fromJson(Map<
String, dynamic> jsonData) -
Deserializes a SentryUser from JSON Map.
factory
Properties
-
data
↔ Map<
String, dynamic> ? -
Any other user context information that may be helpful.
getter/setter pair
- email ↔ String?
-
The email address of the user.
getter/setter pair
-
extras
↔ Map<
String, dynamic> ? -
getter/setter pair
- geo ↔ SentryGeo?
-
Approximate geographical location of the end user or device.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
A unique identifier of the user.
getter/setter pair
- ipAddress ↔ String?
-
The IP of the user.
getter/setter pair
- name ↔ String?
-
Human readable name of the user.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
unknown
→ Map<
String, dynamic> ? -
final
- username ↔ String?
-
The username of the user.
getter/setter pair
Methods
-
copyWith(
{String? id, String? username, String? email, String? ipAddress, Map< String, dynamic> ? extras, String? name, SentryGeo? geo, Map<String, dynamic> ? data}) → SentryUser -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Produces a Map that can be serialized to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited