feat(directory): add 'Create Bucket' option to actions menu
This commit is contained in:
parent
f7352eb3c3
commit
4a01371fad
@ -267,7 +267,7 @@ class _DirectoryViewState extends State<DirectoryView> {
|
|||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
List<PopupMenuEntry<int>> menuItems = [];
|
List<PopupMenuEntry<int>> menuItems = [];
|
||||||
|
|
||||||
// Section: Actions (Always visible now)
|
// Section: Actions
|
||||||
menuItems.add(
|
menuItems.add(
|
||||||
const PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
@ -282,6 +282,38 @@ class _DirectoryViewState extends State<DirectoryView> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Create Bucket option
|
||||||
|
menuItems.add(
|
||||||
|
PopupMenuItem<int>(
|
||||||
|
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<bool>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
builder: (_) => const CreateBucketBottomSheet(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (created == true) {
|
||||||
|
await controller.fetchBuckets();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Manage Buckets option
|
||||||
menuItems.add(
|
menuItems.add(
|
||||||
PopupMenuItem<int>(
|
PopupMenuItem<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
@ -318,6 +350,7 @@ class _DirectoryViewState extends State<DirectoryView> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Show Inactive switch
|
||||||
menuItems.add(
|
menuItems.add(
|
||||||
PopupMenuItem<int>(
|
PopupMenuItem<int>(
|
||||||
value: 0,
|
value: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user