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 }