The surveys module lets you collect user feedback through in-app surveys. Surveys can trigger automatically based on events or be presented manually.
Present a Survey Manually
final presented = await AppDNA.surveys.present("nps_q1_2026");
if (!presented) {
print("Survey not found or already completed");
}
Module Access
final surveys = AppDNA.surveys;
Module Methods
| Method | Signature | Description |
|---|
present | Future<bool> present(String surveyId) | Present a survey manually |
promptReview | Future<void> promptReview() | Start the smart review prompting flow |
set delegate | set delegate(SurveyDelegate?) | Set a delegate for survey callbacks |
8 Question Types
| Type | Display | Response |
|---|
nps | 0-10 numeric scale | Integer 0-10 |
csat | 1-5 satisfaction scale | Integer 1-5 |
rating | Star rating | Integer 1-5 |
emoji_scale | Emoji options | Selected emoji value |
yes_no | Binary choice | Boolean |
single_choice | Radio button options | Selected option string |
multi_choice | Checkbox options | List of selected strings |
free_text | Text input field | Free-form string |
Smart Review Prompting
A two-step flow that routes happy users to the native store review dialog and unhappy users to a feedback form:
- In-app question: “Do you enjoy using [app]?”
- Positive — shows App Store / Play Store review dialog
- Negative — shows a free-text feedback form
await AppDNA.surveys.promptReview();
Rate-limited: maximum 3 times per year, at least 90 days apart. The SDK enforces these limits automatically.
SurveyDelegate
class FeedbackHandler extends SurveyDelegate {
@override
void onSurveyPresented(String surveyId) {
print("Survey shown: $surveyId");
}
@override
void onSurveyResponseSubmitted(String surveyId, List<SurveyAnswer> responses) {
for (final answer in responses) {
if (answer.questionType == "nps") {
final score = answer.numericValue ?? 0;
if (score >= 9) showReferralPrompt();
else if (score <= 6) showSupportLink();
}
}
}
@override
void onSurveyDismissed(String surveyId) {
print("Survey dismissed: $surveyId");
}
}
AppDNA.surveys.delegate = FeedbackHandler();
SurveyAnswer
| Property | Type | Description |
|---|
questionId | String | Identifier for the question |
questionType | String | Question type |
stringValue | String? | Text response |
numericValue | int? | Numeric response |
arrayValue | List<String>? | Multi-select response |
boolValue | bool? | Boolean response |
Auto-Tracked Events
| Event | Trigger |
|---|
survey_presented | A survey is displayed |
survey_response_submitted | User submits a survey response |
survey_dismissed | Survey is closed without completing |
Full Example
import 'package:appdna_sdk/appdna_sdk.dart';
class FeedbackManager extends SurveyDelegate {
FeedbackManager() {
AppDNA.surveys.delegate = this;
}
Future<void> askForFeedback() async {
await AppDNA.surveys.present("nps_q1_2026");
}
Future<void> promptForReview() async {
await AppDNA.surveys.promptReview();
}
@override
void onSurveyPresented(String surveyId) { }
@override
void onSurveyResponseSubmitted(String surveyId, List<SurveyAnswer> responses) {
final nps = responses.firstWhere(
(a) => a.questionType == "nps",
orElse: () => SurveyAnswer.empty(),
);
final score = nps.numericValue ?? 0;
if (score >= 9) showReferralPrompt();
else if (score <= 6) showSupportLink();
}
@override
void onSurveyDismissed(String surveyId) { }
}
Surveys are created in the Console under Feedback > Surveys. Trigger-based surveys appear automatically — use present() for precise control over timing.