@@ -10,6 +10,7 @@ import 'package:saber/components/home/move_note_button.dart';
1010import 'package:saber/components/home/new_note_button.dart' ;
1111import 'package:saber/components/home/no_files.dart' ;
1212import 'package:saber/components/home/rename_note_button.dart' ;
13+ import 'package:saber/components/home/select_all_button.dart' ;
1314import 'package:saber/components/home/syncing_button.dart' ;
1415import 'package:saber/data/file_manager/file_manager.dart' ;
1516import 'package:saber/data/routes.dart' ;
@@ -31,6 +32,13 @@ class BrowsePage extends StatefulWidget {
3132class _BrowsePageState extends State <BrowsePage > {
3233 DirectoryChildren ? children;
3334
35+ List <String > get notesInCwd {
36+ return [
37+ for (String filePath in children? .files ?? const [])
38+ "${path ?? "" }/$filePath " ,
39+ ];
40+ }
41+
3442 final List <String ?> pathHistory = [];
3543 String ? path;
3644
@@ -185,10 +193,7 @@ class _BrowsePageState extends State<BrowsePage> {
185193 ),
186194 sliver: MasonryFiles (
187195 crossAxisCount: crossAxisCount,
188- files: [
189- for (String filePath in children? .files ?? const [])
190- "${path ?? "" }/$filePath " ,
191- ],
196+ files: notesInCwd,
192197 selectedFiles: selectedFiles,
193198 ),
194199 ),
@@ -234,6 +239,17 @@ class _BrowsePageState extends State<BrowsePage> {
234239 },
235240 icon: const Icon (Icons .delete_forever),
236241 ),
242+ SelectAllNotesButton (
243+ selectedFiles: selectedFiles.value,
244+ allFiles: notesInCwd,
245+ selectAll: () => {
246+ selectedFiles.value.clear (),
247+ for (String filePath in notesInCwd)
248+ selectedFiles.value.add (filePath),
249+ setState (() {})
250+ },
251+ deselectAll: () => {selectedFiles.value = []},
252+ ),
237253 ExportNoteButton (
238254 selectedFiles: selectedFiles.value,
239255 ),
0 commit comments