From d37941c66f82bfbe44370ca225d7a210a31f31ef Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 10 Mar 2020 09:53:33 +0900 Subject: [PATCH] album: fixed scroll thumb height --- lib/widgets/album/thumbnail_collection.dart | 32 ++++++++++++--------- pubspec.lock | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/widgets/album/thumbnail_collection.dart b/lib/widgets/album/thumbnail_collection.dart index bc2d01512..ed5614ed9 100644 --- a/lib/widgets/album/thumbnail_collection.dart +++ b/lib/widgets/album/thumbnail_collection.dart @@ -44,17 +44,8 @@ class ThumbnailCollection extends StatelessWidget { columnCountNotifier: _columnCountNotifier, child: ValueListenableBuilder( valueListenable: _columnCountNotifier, - builder: (context, columnCount, child) => DraggableScrollbar( - heightScrollThumb: 48, - backgroundColor: Colors.white, - scrollThumbBuilder: _thumbArrowBuilder(false), - controller: _scrollController, - padding: EdgeInsets.only( - // padding to get scroll thumb below app bar, above nav bar - top: topPadding, - bottom: mqViewInsetsBottom, - ), - child: CustomScrollView( + builder: (context, columnCount, child) { + final scrollView = CustomScrollView( key: _scrollableKey, controller: _scrollController, slivers: [ @@ -79,8 +70,21 @@ class ThumbnailCollection extends StatelessWidget { ), ), ], - ), - ), + ); + + return DraggableScrollbar( + heightScrollThumb: 48, + backgroundColor: Colors.white, + scrollThumbBuilder: _thumbArrowBuilder(false), + controller: _scrollController, + padding: EdgeInsets.only( + // padding to get scroll thumb below app bar, above nav bar + top: topPadding, + bottom: mqViewInsetsBottom, + ), + child: scrollView, + ); + }, ), ); }, @@ -103,11 +107,11 @@ class ThumbnailCollection extends StatelessWidget { Radius.circular(12.0), ), ), + height: height, margin: const EdgeInsets.only(right: .5), padding: const EdgeInsets.all(2), child: ClipPath( child: Container( - height: height, width: 20.0, decoration: BoxDecoration( color: backgroundColor, diff --git a/pubspec.lock b/pubspec.lock index 06d22eb98..3a55a9688 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -76,7 +76,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: d7bd215380458393bd3dd5aa2e671f73606086f8 + resolved-ref: "3b823ae0a9def4edec62771f18e6348312bfce15" url: "git://github.com/deckerst/flutter-draggable-scrollbar.git" source: git version: "0.0.4"