added abilty to edit and delete collections
This commit is contained in:
40
lib/widgets/edit_dialog_widgets/edit_dialog_title.dart
Normal file
40
lib/widgets/edit_dialog_widgets/edit_dialog_title.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
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 }
|
||||
Reference in New Issue
Block a user