From ee8229020b3b03fc074b316db4b322af13b807bd Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 27 Nov 2023 19:39:53 +0600 Subject: [PATCH] fix: settings page scrollbar position --- lib/pages/search/search.dart | 5 +++-- lib/pages/settings/settings.dart | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/pages/search/search.dart b/lib/pages/search/search.dart index b19162faa..f4a78d4fe 100644 --- a/lib/pages/search/search.dart +++ b/lib/pages/search/search.dart @@ -114,8 +114,9 @@ class SearchPage extends HookConsumerWidget { ), color: theme.scaffoldBackgroundColor, child: TextField( - autofocus: - queries.none((s) => s.hasPageData && !s.hasPageError), + autofocus: queries + .none((s) => s.hasPageData && !s.hasPageError) && + !kIsMobile, decoration: InputDecoration( prefixIcon: const Icon(SpotubeIcons.search), hintText: "${context.l10n.search}...", diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index 842d52403..f773b8091 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -30,12 +30,13 @@ class SettingsPage extends HookConsumerWidget { title: Text(context.l10n.settings), centerTitle: true, ), - body: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Flexible( - child: Container( - constraints: const BoxConstraints(maxWidth: 1366), + body: Scrollbar( + controller: controller, + child: Center( + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 1366), + child: ScrollConfiguration( + behavior: const ScrollBehavior().copyWith(scrollbars: false), child: ListView( controller: controller, children: [ @@ -59,7 +60,7 @@ class SettingsPage extends HookConsumerWidget { ), ), ), - ], + ), ), ), );