LimeniaReportForm class

A form to report content or a user: a category, an optional text and, if configured, a confirmation of good faith. It never sends anything itself: it calls onSubmit and shows the ReportResult it returns.

showLimeniaReportSheet shows it in a bottom sheet. To embed it in a page, put it in a scroll view: it is as tall as its content.

The free text is checked with validateReport of package:limenia: at most ReportLimits.reasonTextLength characters (Unicode code points), never stricter than Limenia.

Inheritance

Constructors

LimeniaReportForm({Key? key, required Future<ReportResult> onSubmit(ReportDraft draft), List<ReportCategoryOption>? categories, GoodFaithConfirmation goodFaith = GoodFaithConfirmation.hidden, ReportEmergencyHint? emergencyHint = const ReportEmergencyHint(), String? title, LimeniaUiStrings? strings, ValueChanged<ReportResult>? onResult, VoidCallback? onClose})
Creates the form.
const

Properties

categories → List<ReportCategoryOption>?
The categories to choose from, in this order. Null for the default categories of Limenia (ReportCategoryOption.defaults). Every code must pass ReasonCategory.isValid and appear once.
final
emergencyHint → ReportEmergencyHint?
The hint for categories where someone may be in danger. Null for none.
final
goodFaith → GoodFaithConfirmation
Whether to ask for a confirmation of good faith. Hidden by default.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onClose → VoidCallback?
Called by the close button. Without it there is none, and the result stays on screen.
final
onResult → ValueChanged<ReportResult>?
Called with every result of onSubmit.
final
onSubmit → Future<ReportResult> Function(ReportDraft draft)
Sends the report, usually with Limenia.report, and returns its result. If it throws, the form shows a failure with "Try again" and reports the error to FlutterError.reportError.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strings → LimeniaUiStrings?
Texts of the form. Null for LimeniaUiStrings.of.
final
title → String?
Title of the form, LimeniaUiStrings.reportTitle by default.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<LimeniaReportForm>
Creates the mutable state for this widget at a given location in the tree.
override
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