refactor: Enable lint use_build_context_synchronously
This commit is contained in:
parent
a3fc1bff01
commit
3296c0d92d
50 changed files with 490 additions and 293 deletions
|
|
@ -15,6 +15,7 @@ class PinnedEvents extends StatelessWidget {
|
|||
const PinnedEvents(this.controller, {super.key});
|
||||
|
||||
Future<void> _displayPinnedEventsDialog(BuildContext context) async {
|
||||
final l10n = L10n.of(context);
|
||||
final eventsResult = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => Future.wait(
|
||||
|
|
@ -25,13 +26,14 @@ class PinnedEvents extends StatelessWidget {
|
|||
);
|
||||
final events = eventsResult.result;
|
||||
if (events == null) return;
|
||||
if (!context.mounted) return;
|
||||
|
||||
final eventId = events.length == 1
|
||||
? events.single?.eventId
|
||||
: await showModalActionPopup<String>(
|
||||
context: context,
|
||||
title: L10n.of(context).pin,
|
||||
cancelLabel: L10n.of(context).cancel,
|
||||
title: l10n.pin,
|
||||
cancelLabel: l10n.cancel,
|
||||
actions: events
|
||||
.map(
|
||||
(event) => AdaptiveModalAction(
|
||||
|
|
@ -39,7 +41,7 @@ class PinnedEvents extends StatelessWidget {
|
|||
icon: const Icon(Icons.push_pin_outlined),
|
||||
label:
|
||||
event?.calcLocalizedBodyFallback(
|
||||
MatrixLocals(L10n.of(context)),
|
||||
MatrixLocals(l10n),
|
||||
withSenderNamePrefix: true,
|
||||
hideReply: true,
|
||||
) ??
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue