added logic to save collections and display them

This commit is contained in:
2025-09-19 21:04:57 +02:00
parent d0feca1ba8
commit a4d760a970
2 changed files with 35 additions and 8 deletions

View File

@@ -2,13 +2,19 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CreateBookmarkCollectionDialog extends StatelessWidget {
const CreateBookmarkCollectionDialog({super.key});
const CreateBookmarkCollectionDialog({
super.key,
required this.onSavePressed,
});
final void Function(String name) onSavePressed;
@override
Widget build(BuildContext context) {
final nameController = TextEditingController();
return AlertDialog(
title: Text('Create Collection'),
content: TextField(
controller: nameController,
autofocus: true,
maxLines: 1,
maxLength: 50,
@@ -22,7 +28,13 @@ class CreateBookmarkCollectionDialog extends StatelessWidget {
),
),
actions: [
FloatingActionButton(onPressed: () {}, child: Icon(Icons.save)),
FloatingActionButton(
onPressed: () {
onSavePressed(nameController.text);
Navigator.of(context).pop();
},
child: Icon(Icons.save),
),
],
);
}