Files
maps_bookmarks/lib/widgets/edit_dialog_widgets/edit_dialog_title.dart
marco b4016e6e5b
All checks were successful
Flutter APK Build / Build Flutter APK (pull_request) Successful in 7m28s
localized dialog
2026-01-22 18:23:05 +01:00

42 lines
1.1 KiB
Dart

import 'package:flutter/material.dart' show TextButton, Theme;
import 'package:flutter/widgets.dart';
import '../../l10n/app_localizations.dart';
class EditDialogTitle extends StatelessWidget {
const EditDialogTitle({
super.key,
this.onDeletePressed,
required this.dialogType,
});
final VoidCallback? onDeletePressed;
final DialogType dialogType;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (dialogType == DialogType.bookmark)
Text(AppLocalizations.of(context)!.createBookmark)
else
Text(AppLocalizations.of(context)!.createCollection),
if (onDeletePressed != null)
TextButton(
onPressed: () {
onDeletePressed!.call();
Navigator.of(context).pop();
},
child: Text(
AppLocalizations.of(context)!.delete,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
),
],
);
}
}
enum DialogType { bookmark, collection }