FeedbackButton class
A FloatingActionButton that opens FeedbackWidget in a bottom sheet.
Drop this into your Scaffold.floatingActionButton for an instant feedback flow with zero boilerplate.
Scaffold(
floatingActionButton: FeedbackButton(
backend: WebhookBackend(url: 'https://example.com/feedback'),
appVersion: '1.0.0',
metadataCollector: FeedbackMetadataCollector(),
showRating: true,
),
body: MyApp(),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- FeedbackButton
Constructors
-
FeedbackButton({Key? key, required FeedbackBackend backend, required String appVersion, Widget? child, VoidCallback? onSuccess, void onError(Object)?, VoidCallback? onQueued, List<
FeedbackCategoryItem> ? categories, int maxMessageLength = 2000, int maxScreenshots = 5, String? submitLabel, String? successMessage, String? queuedMessage, int imageQuality = 60, double maxImageWidth = 800, double maxImageHeight = 800, SpeechRecognitionService? speechService, Future<Uint8List?> onCaptureScreenshot()?, bool autoCapture = false, FeedbackThemeData? theme, FeedbackAnalytics? analytics, FeedbackMetadataCollector? metadataCollector, FeedbackSessionContext? sessionContextBuilder()?, bool showRating = false, bool showNps = false, FeedbackLocalizations? localizations, FeedbackTrigger? trigger}) -
const
Properties
- analytics → FeedbackAnalytics?
-
final
- appVersion → String
-
final
- autoCapture → bool
-
Automatically captures the screen when the form opens. Default:
false.final - backend → FeedbackBackend
-
final
-
categories
→ List<
FeedbackCategoryItem> ? -
final
- child → Widget?
-
Custom label widget for the FAB. Defaults to
Text('Feedback').final - hashCode → int
-
The hash code for this object.
no setterinherited
- imageQuality → int
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- localizations → FeedbackLocalizations?
-
final
- maxImageHeight → double
-
final
- maxImageWidth → double
-
final
- maxMessageLength → int
-
final
- maxScreenshots → int
-
final
- metadataCollector → FeedbackMetadataCollector?
-
final
-
onCaptureScreenshot
→ Future<
Uint8List?> Function()? -
final
- onError → void Function(Object)?
-
final
- onQueued → VoidCallback?
-
Called when the entry is saved offline instead of sent.
final
- onSuccess → VoidCallback?
-
final
- queuedMessage → String?
-
Overrides FeedbackLocalizations.queuedMessage.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionContextBuilder → FeedbackSessionContext? Function()?
-
final
- showNps → bool
-
Show NPS (0–10) row. Default:
false.final - showRating → bool
-
Show emoji CSAT rating row. Default:
false.final - speechService → SpeechRecognitionService?
-
final
- submitLabel → String?
-
Overrides FeedbackLocalizations.submitLabel.
final
- successMessage → String?
-
Overrides FeedbackLocalizations.successMessage.
final
- theme → FeedbackThemeData?
-
Visual overrides for the bottom sheet and form.
final
- trigger → FeedbackTrigger?
-
Optional FeedbackTrigger — if provided the button checks FeedbackTrigger.shouldShow
before opening and calls FeedbackTrigger.markShown after opening.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited