FeedbackSessionContext class

Optional user and navigation context attached to a FeedbackEntry.

Pass a builder callback to FeedbackWidget.sessionContextBuilder so the context is captured at submission time — not at widget construction time.

FeedbackWidget(
  backend: myBackend,
  appVersion: '1.0.0',
  sessionContextBuilder: () => FeedbackSessionContext(
    userId: authService.currentUserId,
    currentRoute: GoRouterState.of(context).matchedLocation,
    extra: {'plan': 'pro'},
  ),
)
Annotations

Constructors

FeedbackSessionContext({String? userId, String? currentRoute, Map<String, String> extra = const {}})
const
FeedbackSessionContext.fromJson(Map<String, dynamic> json)
Deserialises from a JSON map produced by toJson.
factory

Properties

currentRoute String?
The active route/screen name when feedback was submitted.
final
extra Map<String, String>
Arbitrary key-value pairs, e.g. subscription plan, feature flags.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String?
Optional anonymous or authenticated user identifier.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialises to a JSON-compatible map. Omits null / empty fields.
toString() String
A string representation of this object.
inherited

Operators

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