Files
maps_bookmarks/lib/widgets/edit_dialog_widgets/edit_dialog_title.dart

41 lines
1.0 KiB
Dart

import 'package:flutter/material.dart' show TextButton, Theme;
import 'package:flutter/widgets.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: [
// TODO: Localize
if (dialogType == DialogType.bookmark)
Text('Create Bookmark')
else
Text('Create Collection'),
if (onDeletePressed != null)
TextButton(
onPressed: () {
onDeletePressed!.call();
Navigator.of(context).pop();
},
child: Text(
'Delete',
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
),
],
);
}
}
enum DialogType { bookmark, collection }