From 4a01371fadb02c9c466c8de14c513a020a11826b Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 21 Jul 2025 16:22:18 +0530 Subject: [PATCH] feat(directory): add 'Create Bucket' option to actions menu --- lib/view/directory/directory_view.dart | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/view/directory/directory_view.dart b/lib/view/directory/directory_view.dart index 30c8caa..2230a24 100644 --- a/lib/view/directory/directory_view.dart +++ b/lib/view/directory/directory_view.dart @@ -267,7 +267,7 @@ class _DirectoryViewState extends State { itemBuilder: (context) { List> menuItems = []; - // Section: Actions (Always visible now) + // Section: Actions menuItems.add( const PopupMenuItem( enabled: false, @@ -282,6 +282,38 @@ class _DirectoryViewState extends State { ), ); + // Create Bucket option + menuItems.add( + PopupMenuItem( + value: 2, + child: Row( + children: const [ + Icon(Icons.add_box_outlined, + size: 20, color: Colors.black87), + SizedBox(width: 10), + Expanded(child: Text("Create Bucket")), + Icon(Icons.chevron_right, + size: 20, color: Colors.red), + ], + ), + onTap: () { + Future.delayed(Duration.zero, () async { + final created = await showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (_) => const CreateBucketBottomSheet(), + ); + + if (created == true) { + await controller.fetchBuckets(); + } + }); + }, + ), + ); + + // Manage Buckets option menuItems.add( PopupMenuItem( value: 1, @@ -318,6 +350,7 @@ class _DirectoryViewState extends State { ), ); + // Show Inactive switch menuItems.add( PopupMenuItem( value: 0,