mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-25 08:12:19 +08:00
FolderView: Add ScrollBar and RefreshIndicator
The scrollbar isn't perfectly placed, but it will have to do for now.
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:git_bindings/git_bindings.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'package:gitjournal/app.dart';
|
import 'package:gitjournal/app.dart';
|
||||||
@ -140,8 +141,17 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
];
|
];
|
||||||
},
|
},
|
||||||
floatHeaderSlivers: true,
|
floatHeaderSlivers: true,
|
||||||
body: CustomScrollView(
|
body: Scrollbar(
|
||||||
slivers: [folderView],
|
child: Builder(builder: (context) {
|
||||||
|
var view = CustomScrollView(slivers: [folderView]);
|
||||||
|
if (settings.remoteSyncFrequency == RemoteSyncFrequency.Manual) {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
return RefreshIndicator(
|
||||||
|
onRefresh: () => _syncRepo(context),
|
||||||
|
child: view,
|
||||||
|
);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -159,22 +169,6 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Builder(builder: _buildBody),
|
body: Builder(builder: _buildBody),
|
||||||
/*
|
|
||||||
Center(
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
var child = Scrollbar(child: folderView);
|
|
||||||
if (settings.remoteSyncFrequency == RemoteSyncFrequency.Manual) {
|
|
||||||
return child;
|
|
||||||
}
|
|
||||||
return RefreshIndicator(
|
|
||||||
child: child,
|
|
||||||
onRefresh: () async => _syncRepo(context),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
*/
|
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
drawer: AppDrawer(),
|
drawer: AppDrawer(),
|
||||||
floatingActionButton: createButton,
|
floatingActionButton: createButton,
|
||||||
@ -185,9 +179,6 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
BUG: https://github.com/flutter/flutter/issues/54272
|
|
||||||
|
|
||||||
Future<void> _syncRepo(BuildContext context) async {
|
Future<void> _syncRepo(BuildContext context) async {
|
||||||
try {
|
try {
|
||||||
var container = context.read<GitJournalRepo>();
|
var container = context.read<GitJournalRepo>();
|
||||||
@ -201,7 +192,6 @@ class _FolderViewState extends State<FolderView> {
|
|||||||
showSnackbar(context, e.toString());
|
showSnackbar(context, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
void _newPost(EditorType editorType) async {
|
void _newPost(EditorType editorType) async {
|
||||||
var folder = widget.notesFolder;
|
var folder = widget.notesFolder;
|
||||||
|
Reference in New Issue
Block a user