Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion feedback/lib/src/user_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:feedback/src/better_feedback.dart';
class UserFeedback {
/// Creates an [UserFeedback].
/// Typically never used by a user of this library.
UserFeedback({
const UserFeedback({
required this.text,
required this.screenshot,
this.extra,
Expand All @@ -22,4 +22,21 @@ class UserFeedback {
/// When using a custom [BetterFeedback.feedbackBuilder] this can be used
/// to supply additional information.
final Map<String, dynamic>? extra;

/// Creates a copy of this [UserFeedback] with the given fields replaced
/// by new values.
///
/// Any parameter that is omitted will default to the value of the
/// corresponding field in this instance.
UserFeedback copyWith({
String? text,
Uint8List? screenshot,
Map<String, dynamic>? extra,
}) {
return UserFeedback(
text: text ?? this.text,
screenshot: screenshot ?? this.screenshot,
extra: extra ?? this.extra,
);
}
}