suggestly_flutter

Reusable, fully themeable Material 3 dialogs that capture text input, feature requests, bug reports (including environment metadata and screenshots), and star ratings. Every popup respects accessibility, null safety, and text scaling and can be themed globally or per instance.

Features

  • FeatureRequestPopup - reproduces the Suggestly feature form with priority and version inputs.
  • BugReportPopup - mirrors the Suggestly web bug report, collecting environment details and up to five validated screenshots via the built-in file picker.
  • RatingPopup - star-based selector with optional comment and custom labels.
  • Shared action model, barrier configuration, autofocus, and semantic labels for all popups.

Getting started

Add the dependency to your pubspec.yaml (path assumes the monorepo layout):

dependencies:
  suggestly_flutter:
    path: ../suggestly.packages/suggestly_flutter

Then import the package:

import 'package:suggestly_flutter/suggestly_flutter.dart';

Before showing any Suggestly dialogs, initialise the shared client with your API key:

void main() {
  Suggestly.initialize(apiKey: 'YOUR-API-KEY-HERE');
  runApp(const MyApp());
}

Provide the current user's identity via SuggestlyUserContext whenever you present a popup.

Usage

Feature requests

final SuggestlyUserContext user = SuggestlyUserContext(
  userId: currentUser.id,
  emailAddress: currentUser.email,
  name: currentUser.displayName,
);

final bool? featureSubmitted = await FeatureRequestPopup.show(
  context,
  title: 'Request a feature',
  message: 'Share what would make Suggestly more helpful.',
  user: user,
  submitLabel: 'Submit request',
);

if (featureSubmitted == true) {
  debugPrint('We logged the feature request.');
}

Bug reports (with attachments)

final bool? submitted = await BugReportPopup.show(
  context,
  title: 'Report a bug',
  message: 'Screenshots are optional but recommended.',
  submitLabel: 'Send report',
  user: user,
);

if (submitted == true) {
  debugPrint('Thanks for the report!');
}

The popup guides users through adding up to five screenshots using the built-in file_selector integration. Attachments are validated for file type and size, renamed deterministically, and uploaded alongside the report.

Ratings

final bool? ratingSubmitted = await RatingPopup.show(
  context,
  title: 'Rate your experience',
  message: 'Stars help us prioritise improvements.',
  user: user,
  ratingLabelBuilder: (value) => '$value / 5',
  submitLabel: 'Submit rating',
);

if (ratingSubmitted == true) {
  debugPrint('Thanks for the feedback!');
}

Theming

Wrap a subtree with TextInputPopupTheme to provide defaults that apply to every popup, or pass themeOverrides to individual dialogs:

TextInputPopupTheme(
  data: TextInputPopupThemeData(
    backgroundColor: Theme.of(context).colorScheme.surface,
    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
    contentPadding: const EdgeInsets.fromLTRB(28, 28, 28, 20),
  ),
  child: Builder(
    builder: (context) => FilledButton(
      onPressed: () {
        FeatureRequestPopup.show(
          context,
          title: 'Request a feature',
          message: 'Tell us what would make Suggestly better.',
          user: user,
          themeOverrides: const TextInputPopupThemeData(
            primaryButtonStyle: FilledButton.styleFrom(
              minimumSize: Size(140, 40),
            ),
          ),
        );
      },
      child: const Text('Request feature'),
    ),
  ),
);

Additional information

  • flutter analyze and flutter test run clean.
  • BugReportPopup owns the attachment workflow with file_selector, enforcing the same limits as the Suggestly web app (image formats only, up to five files, 5 MB each).
  • Contributions, issues, and suggestions are welcome.

Libraries

suggestly_flutter