mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
FolderView: Pass correct context
This commit is contained in:
@ -81,20 +81,12 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
Widget _buildBody(BuildContext context) {
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var createButton = FloatingActionButton(
|
|
||||||
key: const ValueKey("FAB"),
|
|
||||||
onPressed: () => _newPost(widget.notesFolder.config.defaultEditor),
|
|
||||||
child: const Icon(Icons.add),
|
|
||||||
);
|
|
||||||
|
|
||||||
var title = widget.notesFolder.publicName;
|
var title = widget.notesFolder.publicName;
|
||||||
if (inSelectionMode) {
|
if (inSelectionMode) {
|
||||||
title = NumberFormat.compact().format(1);
|
title = NumberFormat.compact().format(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// vHanda: Fixme the openNoteEditor will fail! Wrong context!
|
|
||||||
var folderView = buildFolderView(
|
var folderView = buildFolderView(
|
||||||
viewType: _viewType,
|
viewType: _viewType,
|
||||||
folder: sortedNotesFolder,
|
folder: sortedNotesFolder,
|
||||||
@ -135,21 +127,35 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
onPressed: _resetSelection,
|
onPressed: _resetSelection,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
title: Text(title),
|
||||||
|
leading: inSelectionMode ? backButton : GJAppBarMenuButton(),
|
||||||
|
actions: inSelectionMode
|
||||||
|
? _buildInSelectionNoteActions()
|
||||||
|
: _buildNoteActions(),
|
||||||
|
floating: true,
|
||||||
|
forceElevated: true,
|
||||||
|
),
|
||||||
|
folderView,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var createButton = FloatingActionButton(
|
||||||
|
key: const ValueKey("FAB"),
|
||||||
|
onPressed: () => _newPost(widget.notesFolder.config.defaultEditor),
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
);
|
||||||
|
|
||||||
|
var settings = Provider.of<Settings>(context);
|
||||||
|
final showButtomMenuBar = settings.bottomMenuBar;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: CustomScrollView(
|
body: Builder(builder: _buildBody),
|
||||||
slivers: [
|
|
||||||
SliverAppBar(
|
|
||||||
title: Text(title),
|
|
||||||
leading: inSelectionMode ? backButton : GJAppBarMenuButton(),
|
|
||||||
actions: inSelectionMode
|
|
||||||
? _buildInSelectionNoteActions()
|
|
||||||
: _buildNoteActions(),
|
|
||||||
floating: true,
|
|
||||||
forceElevated: true,
|
|
||||||
),
|
|
||||||
folderView,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
/*
|
/*
|
||||||
Center(
|
Center(
|
||||||
child: Builder(
|
child: Builder(
|
||||||
|
Reference in New Issue
Block a user