Skip to content

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

VariableTypeDefaultDescription
includeFeatureVotingbooleantrueEnable feature-request listing and voting (GET/POST /feature-requests)
defaultEndpointstring""Default endpoint URL pre-filled in FeedbackConfig (can be changed later)

Usage

Interactive

bash
archipelago generate feedback_sdk

Non-interactive (CI)

bash
archipelago generate feedback_sdk --config my_config.json

Generated 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:

dart
@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:

dart
connectivitySDK.stateStream.listen((state) {
  feedbackSDK.recordConnectivity(online: state.isOnline);
});

The queue drains automatically when connectivity is restored.

Submitting Feedback

dart
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:

dart
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:

dart
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.

Built by Banua Coder