FeedbackEntry class
Represents a single piece of in-app user feedback.
Entries are immutable value objects. Use copyWith to produce modified copies, and toJson / fromJson (or the compact encode / decode pair) for serialisation — e.g. when persisting to a queue.
Constructors
-
FeedbackEntry({required String category, required String message, required String platform, required String appVersion, required DateTime createdAt, List<
String> screenshots = const [], FeedbackMetadata? metadata, FeedbackSessionContext? sessionContext, int? rating, int? npsScore}) -
Creates a feedback entry.
const
-
FeedbackEntry.fromJson(Map<
String, dynamic> json) -
Deserialises from a JSON map previously produced by toJson.
factory
Properties
- appVersion → String
-
Application version string at the time of submission.
final
- category → String
-
The category id selected by the user.
final
- createdAt → DateTime
-
UTC timestamp when the entry was created.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- message → String
-
The free-text message entered by the user (max 2 000 characters).
final
- metadata → FeedbackMetadata?
-
Optional device / app metadata collected by FeedbackMetadataCollector.
final
- npsScore → int?
-
Optional 0–10 Net Promoter Score from FeedbackNpsWidget.
final
- platform → String
-
Platform identifier, e.g.
'android'or'ios'.final - rating → int?
-
Optional 1–5 satisfaction rating from FeedbackRatingWidget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
screenshots
→ List<
String> -
Base64-encoded PNG screenshots attached to this entry.
final
- sessionContext → FeedbackSessionContext?
-
Optional session context (user ID, current route, custom KVs).
final
Methods
-
copyWith(
{String? category, String? message, String? platform, String? appVersion, DateTime? createdAt, List< String> ? screenshots, FeedbackMetadata? metadata, FeedbackSessionContext? sessionContext, int? rating, int? npsScore}) → FeedbackEntry - Returns a copy with the specified fields replaced.
-
encode(
) → String - Encodes this entry to a compact JSON string suitable for storage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialises this entry to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
decode(
String source) → FeedbackEntry - Restores an entry from a string previously returned by encode.