feedback_sdk Pro
In-app feedback SDK with offline queue, metadata enrichment, and optional feature voting. Configurable endpoint, app version/device info attachment, and queue limit.
Version: 1.0.0
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| includeFeatureVoting | boolean | true | Enable feature-request listing and voting (GET/POST /feature-requests) |
| defaultEndpoint | string | "" | Default endpoint URL pre-filled in FeedbackConfig (can be changed later) |
Usage
Interactive
archipelago generate feedback_sdkNon-interactive (CI)
archipelago generate feedback_sdk --config my_config.jsonGenerated Structure
features/
└── feedback/
├── feedback_api/
│ └── lib/src/
│ └── models/
└── feedback_impl/
└── lib/src/
├── data/
└── di/Endpoint Configuration
After generation, set your endpoint in the DI @module override:
@module
abstract class AppFeedbackModule {
@lazySingleton
FeedbackConfig get feedbackConfig => const FeedbackConfig(
endpoint: 'https://api.yourapp.com/feedback',
attachAppVersion: true,
attachDeviceInfo: true,
);
}Register this module before FeedbackImplPackageModule.
Offline Queue
Submissions are held in SharedPreferences when the device is offline or the server returns a 5xx. Wire connectivity_sdk to flush the queue automatically:
connectivitySDK.stateStream.listen((state) {
feedbackSDK.recordConnectivity(online: state.isOnline);
});The queue drains automatically when connectivity is restored.
Submitting Feedback
await feedbackSDK.submit(
FeedbackSubmission(
text: 'The checkout button is hard to find',
category: FeedbackCategory.bug,
screenshotPath: await _captureScreenshot(),
),
);Shake-to-Feedback (Optional)
Install shake and call submit() from a ShakeDetector callback:
ShakeDetector.autoStart(
onPhoneShake: () async {
await feedbackSDK.submit(
FeedbackSubmission(
text: await _promptUserForText(),
category: FeedbackCategory.general,
),
);
},
);Feature Voting
When includeFeatureVoting is true, users can browse and upvote feature requests:
final requests = await feedbackSDK.getFeatureRequests();
final result = await feedbackSDK.voteOnFeatureRequest(requests.first.id);Votes are locally deduplicated — a second call for the same requestId returns FeatureRequestVoteResultAlreadyVoted without hitting the network.