Add a scrollbar for bottom action bar (#1561)

This commit is contained in:
Vishnu Mohandas 2023-12-02 18:02:46 +05:30 committed by GitHub
parent 700de0dd8b
commit 3441c950d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 17 deletions

View file

@ -49,13 +49,12 @@ class BottomActionBarWidget extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 12),
const SizedBox(height: 8),
FileSelectionActionsWidget(
galleryType,
selectedFiles,
collection: collection,
),
const SizedBox(height: 20),
const DividerWidget(dividerType: DividerType.bottomBar),
ActionBarWidget(
selectedFiles: selectedFiles,

View file

@ -319,21 +319,30 @@ class _FileSelectionActionsWidgetState
);
if (items.isNotEmpty) {
return SizedBox(
width: double.infinity,
child: Center(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(
decelerationRate: ScrollDecelerationRate.fast,
),
scrollDirection: Axis.horizontal,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: 4),
...items,
const SizedBox(width: 4),
],
final scrollController = ScrollController();
// h4ck: https://github.com/flutter/flutter/issues/57920#issuecomment-893970066
return MediaQuery(
data: MediaQuery.of(context).removePadding(removeBottom: true),
child: SafeArea(
child: Scrollbar(
controller: scrollController,
thumbVisibility: true,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(
decelerationRate: ScrollDecelerationRate.fast,
),
scrollDirection: Axis.horizontal,
child: Container(
padding: const EdgeInsets.only(bottom: 24),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: 4),
...items,
const SizedBox(width: 4),
],
),
),
),
),
),