reportChat method
Reports the chat.
Implementation
Future<void> reportChat() async {
String? encodeQueryParameters(Map<String, String> params) {
return params.entries
.map(
(e) =>
'${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value)}',
)
.join('&');
}
try {
await launchUrl(
Uri(
scheme: 'mailto',
path: Config.support,
query: encodeQueryParameters({
'subject': '[Abuse] Report on ChatId($chatId)',
'body': '${reporting.text}\n\n',
}),
),
);
} catch (e) {
await MessagePopup.error(
'label_contact_us_via_provided_email'.l10nfmt({
'email': Config.support,
}),
);
}
}