@@ -26,12 +26,12 @@ part 'app_review_config.g.dart';
2626///
2727/// 3. **User Interaction & State Change**:
2828/// - **On "Yes" (Positive Feedback)**:
29- /// - An `AppReview` record is created/updated with `initialFeedback: positive`
30- /// and `wasStoreReviewRequested` is set to `true`.
31- /// - The native OS in-app review dialog is immediately triggered. This is a
32- /// "fire-and-forget" action; the OS controls if the dialog appears and
33- /// provides no feedback to the app.
34- /// - The `UserFeedDecoratorStatus` for `rateApp` has its `isCompleted` flag
29+ /// - An `AppReview` record is created/updated with `initialFeedback: positive`.
30+ /// - If [isPositiveFeedbackFollowUpEnabled] is `true`, the native OS
31+ /// in-app review dialog is triggered. `wasStoreReviewRequested` is set
32+ /// to `true` to record that the attempt was made.
33+ /// - Regardless of whether the dialog was requested, the
34+ /// `UserFeedDecoratorStatus` for `rateApp` has its `isCompleted` flag
3535/// set to `true`, **permanently preventing the internal prompt from
3636/// appearing again for this user.**
3737///
@@ -53,6 +53,7 @@ class AppReviewConfig extends Equatable {
5353 required this .positiveInteractionThreshold,
5454 required this .initialPromptCooldownDays,
5555 required this .isNegativeFeedbackFollowUpEnabled,
56+ required this .isPositiveFeedbackFollowUpEnabled,
5657 });
5758
5859 /// Creates a [AppReviewConfig] from JSON data.
@@ -74,6 +75,12 @@ class AppReviewConfig extends Equatable {
7475 /// text reason after a user provides negative feedback.
7576 final bool isNegativeFeedbackFollowUpEnabled;
7677
78+ /// A switch to enable or disable invoking the native OS in-app review dialog
79+ /// after a user provides positive feedback.
80+ ///
81+ /// This allows for testing the positive flow without consuming review quotas.
82+ final bool isPositiveFeedbackFollowUpEnabled;
83+
7784 /// Converts this [AppReviewConfig] instance to JSON data.
7885 Map <String , dynamic > toJson () => _$AppReviewConfigToJson (this );
7986
@@ -83,6 +90,7 @@ class AppReviewConfig extends Equatable {
8390 positiveInteractionThreshold,
8491 initialPromptCooldownDays,
8592 isNegativeFeedbackFollowUpEnabled,
93+ isPositiveFeedbackFollowUpEnabled,
8694 ];
8795
8896 /// Creates a copy of this [AppReviewConfig] but with the given fields
@@ -92,6 +100,7 @@ class AppReviewConfig extends Equatable {
92100 int ? positiveInteractionThreshold,
93101 int ? initialPromptCooldownDays,
94102 bool ? isNegativeFeedbackFollowUpEnabled,
103+ bool ? isPositiveFeedbackFollowUpEnabled,
95104 }) {
96105 return AppReviewConfig (
97106 enabled: enabled ?? this .enabled,
@@ -102,6 +111,9 @@ class AppReviewConfig extends Equatable {
102111 isNegativeFeedbackFollowUpEnabled:
103112 isNegativeFeedbackFollowUpEnabled ??
104113 this .isNegativeFeedbackFollowUpEnabled,
114+ isPositiveFeedbackFollowUpEnabled:
115+ isPositiveFeedbackFollowUpEnabled ??
116+ this .isPositiveFeedbackFollowUpEnabled,
105117 );
106118 }
107119}
0 commit comments