identify static method

Future<void> identify({
  1. String? userId,
  2. Map<String, dynamic>? traits,
  3. Map<String, dynamic>? options,
})

Identifies a user in Segment.

Use this method to associate a user ID with traits such as name, email, or other profile information. If userId is null, the user will be treated as anonymous.

  • userId: Unique identifier for the user.
  • traits: Optional key-value pairs describing user attributes.
  • options: Optional Segment options to control integrations or override default behavior.

This method is typically called after a user logs in or when user information becomes available.

Implementation

static Future<void> identify({
  String? userId,
  Map<String, dynamic>? traits,
  Map<String, dynamic>? options,
}) {
  return _segment.identify(
    userId: userId,
    traits: traits ?? {},
    options: options ?? SegmentDefaultOptions.instance.options ?? {},
  );
}