mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-26 02:30:00 +08:00
Add support for moving a Note to another folder
The Folder selection dialog needs a lot of work, but it's a start.
This commit is contained in:
31
lib/widgets/folder_selection_dialog.dart
Normal file
31
lib/widgets/folder_selection_dialog.dart
Normal file
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gitjournal/core/notes_folder.dart';
|
||||
import 'package:gitjournal/widgets/folder_tree_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
typedef NoteFolderCallback = void Function(NotesFolder);
|
||||
|
||||
class FolderSelectionDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final notesFolder = Provider.of<NotesFolder>(context);
|
||||
|
||||
var body = Container(
|
||||
width: double.maxFinite,
|
||||
child: FolderTreeView(
|
||||
rootFolder: notesFolder,
|
||||
onFolderEntered: (NotesFolder destFolder) {
|
||||
Navigator.of(context).pop(destFolder);
|
||||
},
|
||||
longPressAllowed: false,
|
||||
),
|
||||
);
|
||||
|
||||
return AlertDialog(
|
||||
title: const Text('Select a Folder'),
|
||||
content: body,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Add the previously as a radio button selected Folder
|
Reference in New Issue
Block a user