ui library

Ready-made Flutter widgets for apps that integrate Limenia: the report sheet (showLimeniaReportSheet, LimeniaReportForm), the complaint form (showLimeniaAppealSheet, LimeniaAppealForm), the statement of reasons (LimeniaStatementOfReasonsView) and the notices for a restricted account (LimeniaRestrictionNotice, LimeniaRestrictionScreen).

The widgets never send anything themselves. They collect the input and call the callbacks of the app, which send it with package:limenia through the backend of the app. The API key of Limenia never belongs in an app.

Texts come in German and English (LimeniaUiStrings), colors and fonts from the Theme of the app. See README.md.

Classes

AppealTopic
What a complaint is about, shown at the top of the complaint form: a short summary of the decision and the end of the window for a complaint.
LimeniaAppealForm
A form for a complaint against a decision (Art. 20 DSA), for the affected user and for reporters alike. It shows what the complaint is about, that it is possible for six months, free of charge and reviewed by a person, and takes the reasons of the user. It never sends anything itself: it calls onSubmit and shows the AppealResult it returns.
LimeniaReportForm
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.
LimeniaRestrictionNotice
A notice about the restriction of the user's account, to place inline, e.g. at the top of a feed or the profile:
LimeniaRestrictionScreen
A full page for a suspended or banned account, e.g. in place of the home screen. Shows nothing for an active or warned user; use LimeniaRestrictionNotice for the warning.
LimeniaStatementOfReasonsView
Shows the statement of reasons of a decision (Art. 17 DSA) to the affected user, e.g. from decision.created (ModerationDecision.statementOfReasons).
LimeniaSubjectStatusBuilder
Builds with the current status of a SubjectStatusWatcher and again on every change, including the end of a suspension.
LimeniaUiStrings
The texts of the Limenia widgets, with built-in German (de) and English (en) versions.
LimeniaUiStringsScope
Overrides the strings of the Limenia widgets below it, per locale.
ReportCategoryOption
A category the user can choose in the report form.
ReportDraft
What the user entered in the report form, handed to the onSubmit callback of LimeniaReportForm and showLimeniaReportSheet.
ReportEmergencyHint
A short hint in the report form for categories where someone may be in danger, e.g. to call the emergency services. Pass null to LimeniaReportForm.emergencyHint to never show one.

Enums

GoodFaithConfirmation
Whether the report form asks the user to confirm that the report is accurate and complete (Art. 16(2)(d) DSA).
SorLayout
How LimeniaStatementOfReasonsView shows a statement of reasons.

Functions

appealDeadlineFor(DateTime decidedAt) → DateTime
The end of the window for a complaint against a decision taken at decidedAt, as Limenia computes it: six calendar months later, on the last day of the target month if it is shorter (31 August to 28 February), at the time of day of the decision. In UTC.
showLimeniaAppealSheet(BuildContext context, {required Future<AppealResult> onSubmit(String text), AppealTopic? topic, String? title, LimeniaUiStrings? strings}) → Future<AppealResult?>
Shows the complaint form (LimeniaAppealForm) in a modal bottom sheet.
showLimeniaReportSheet(BuildContext context, {required Future<ReportResult> onSubmit(ReportDraft draft), List<ReportCategoryOption>? categories, GoodFaithConfirmation goodFaith = GoodFaithConfirmation.hidden, ReportEmergencyHint? emergencyHint = const ReportEmergencyHint(), String? title, LimeniaUiStrings? strings}) → Future<ReportResult?>
Shows the report form (LimeniaReportForm) in a modal bottom sheet.