mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 16:04:43 +01:00
Hide scrollbar before queried all items
This commit is contained in:
parent
3e617ac59e
commit
bc9227d2ad
3 changed files with 8 additions and 3 deletions
|
@ -165,6 +165,7 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
bottomOffset: _calcBottomAppBarExtent(context),
|
bottomOffset: _calcBottomAppBarExtent(context),
|
||||||
labelTextBuilder: (_) => _buildScrollLabel(context),
|
labelTextBuilder: (_) => _buildScrollLabel(context),
|
||||||
labelPadding: const EdgeInsets.symmetric(horizontal: 40),
|
labelPadding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
enabled: _isScrollbarVisible,
|
||||||
child: ScrollConfiguration(
|
child: ScrollConfiguration(
|
||||||
behavior: ScrollConfiguration.of(context)
|
behavior: ScrollConfiguration.of(context)
|
||||||
.copyWith(scrollbars: false),
|
.copyWith(scrollbars: false),
|
||||||
|
@ -380,10 +381,12 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
state is ScanAccountDirBlocLoading) {
|
state is ScanAccountDirBlocLoading) {
|
||||||
_transformItems(state.files);
|
_transformItems(state.files);
|
||||||
if (state is ScanAccountDirBlocSuccess) {
|
if (state is ScanAccountDirBlocSuccess) {
|
||||||
|
_isScrollbarVisible = true;
|
||||||
_startupSync();
|
_startupSync();
|
||||||
_tryStartMetadataTask();
|
_tryStartMetadataTask();
|
||||||
}
|
}
|
||||||
} else if (state is ScanAccountDirBlocFailure) {
|
} else if (state is ScanAccountDirBlocFailure) {
|
||||||
|
_isScrollbarVisible = true;
|
||||||
_transformItems(state.files);
|
_transformItems(state.files);
|
||||||
if (isPageVisible()) {
|
if (isPageVisible()) {
|
||||||
SnackBarManager().showSnackBar(SnackBar(
|
SnackBarManager().showSnackBar(SnackBar(
|
||||||
|
@ -702,6 +705,8 @@ class _HomePhotosState extends State<HomePhotos>
|
||||||
|
|
||||||
late final _Web? _web = platform_k.isWeb ? _Web(this) : null;
|
late final _Web? _web = platform_k.isWeb ? _Web(this) : null;
|
||||||
|
|
||||||
|
var _isScrollbarVisible = false;
|
||||||
|
|
||||||
static final _log = Logger("widget.home_photos._HomePhotosState");
|
static final _log = Logger("widget.home_photos._HomePhotosState");
|
||||||
static const _menuValueRefresh = 0;
|
static const _menuValueRefresh = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,8 +385,8 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: "v0.1.0-nc-photos-5"
|
ref: "v0.1.0-nc-photos-6"
|
||||||
resolved-ref: a1a34c57a069dc1cffa9759f86ffab2e0c7420ca
|
resolved-ref: c3bb889b421451ef9944f25c55b12bda2f83d5c8
|
||||||
url: "https://gitlab.com/nc-photos/flutter-draggable-scrollbar"
|
url: "https://gitlab.com/nc-photos/flutter-draggable-scrollbar"
|
||||||
source: git
|
source: git
|
||||||
version: "0.1.0"
|
version: "0.1.0"
|
||||||
|
|
|
@ -44,7 +44,7 @@ dependencies:
|
||||||
draggable_scrollbar:
|
draggable_scrollbar:
|
||||||
git:
|
git:
|
||||||
url: https://gitlab.com/nc-photos/flutter-draggable-scrollbar
|
url: https://gitlab.com/nc-photos/flutter-draggable-scrollbar
|
||||||
ref: v0.1.0-nc-photos-5
|
ref: v0.1.0-nc-photos-6
|
||||||
drift: ^1.7.1
|
drift: ^1.7.1
|
||||||
equatable: ^2.0.0
|
equatable: ^2.0.0
|
||||||
event_bus: ^2.0.0
|
event_bus: ^2.0.0
|
||||||
|
|
Loading…
Add table
Reference in a new issue