minor fix

This commit is contained in:
Thibault Deckers 2024-04-01 19:21:58 +02:00
parent 08bd187c7d
commit 9f9cdebc9e
2 changed files with 10 additions and 8 deletions

View file

@ -556,15 +556,16 @@ class EntrySetActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAware
} }
Future<void> removeLocation(BuildContext context, Set<AvesEntry> entries) async { Future<void> removeLocation(BuildContext context, Set<AvesEntry> entries) async {
final l10n = context.l10n;
final confirmed = await showDialog<bool>( final confirmed = await showDialog<bool>(
context: context, context: context,
builder: (context) => AvesDialog( builder: (context) => AvesDialog(
content: Text(context.l10n.genericDangerWarningDialogMessage), content: Text(l10n.genericDangerWarningDialogMessage),
actions: [ actions: [
const CancelButton(), const CancelButton(),
TextButton( TextButton(
onPressed: () => Navigator.maybeOf(context)?.pop(true), onPressed: () => Navigator.maybeOf(context)?.pop(true),
child: Text(context.l10n.applyButtonLabel), child: Text(l10n.applyButtonLabel),
), ),
], ],
), ),

View file

@ -12,10 +12,10 @@ abstract class SettingsSection {
FutureOr<List<SettingsTile>> tiles(BuildContext context); FutureOr<List<SettingsTile>> tiles(BuildContext context);
Widget build(BuildContext context, ValueNotifier<String?> expandedNotifier) { Widget build(BuildContext sectionContext, ValueNotifier<String?> expandedNotifier) {
return FutureBuilder<List<SettingsTile>>( return FutureBuilder<List<SettingsTile>>(
future: Future.value(tiles(context)), future: Future.value(tiles(sectionContext)),
builder: (context, snapshot) { builder: (tileContext, snapshot) {
final tiles = snapshot.data; final tiles = snapshot.data;
if (tiles == null) return const SizedBox(); if (tiles == null) return const SizedBox();
@ -25,11 +25,12 @@ abstract class SettingsSection {
// use a fixed value instead of the title to identify this expansion tile // use a fixed value instead of the title to identify this expansion tile
// so that the tile state is kept when the language is modified // so that the tile state is kept when the language is modified
value: key, value: key,
leading: icon(context), leading: icon(tileContext),
title: title(context), title: title(tileContext),
expandedNotifier: expandedNotifier, expandedNotifier: expandedNotifier,
showHighlight: false, showHighlight: false,
children: tiles.map((v) => v.build(context)).toList(), // reuse section context so that dialogs opened from tiles have the right text theme
children: tiles.map((v) => v.build(sectionContext)).toList(),
); );
}, },
); );