From d5916e01b5135ac96e51705250828ca93310b6b1 Mon Sep 17 00:00:00 2001 From: RarDog Date: Sat, 5 Sep 2026 13:16:00 +0300 Subject: [PATCH] fix(artists): resolve double keyboard inset and white square bug during search (v3.5.2) --- lib/app/app_version.dart | 4 ++-- lib/app/changelog.dart | 9 ++++++++ .../artists/presentation/artists_screen.dart | 10 +++++++- lib/shared/widgets/adaptive_scaffold.dart | 4 ++++ lib/shared/widgets/app_shell.dart | 23 ++++++++++++------- pubspec.yaml | 2 +- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/lib/app/app_version.dart b/lib/app/app_version.dart index fbce8df..3069ec3 100644 --- a/lib/app/app_version.dart +++ b/lib/app/app_version.dart @@ -1,3 +1,3 @@ -const appDisplayVersion = '3.5.1'; -const appBuildNumber = 77; +const appDisplayVersion = '3.5.2'; +const appBuildNumber = 78; const appReleaseChannel = 'Stable'; diff --git a/lib/app/changelog.dart b/lib/app/changelog.dart index a199d1c..92a0a77 100644 --- a/lib/app/changelog.dart +++ b/lib/app/changelog.dart @@ -1,4 +1,13 @@ const prismaChangelog = [ + PrismaChange( + version: '3.5.2', + title: 'Исправление наложения клавиатуры и поиска авторов', + bullets: [ + 'Устранена ошибка выдвижения белого прямоугольника: исправлен конфликт двойного учета клавиатурного отступа (double viewInsets) во вложенных скаффолдах.', + 'Корректная видимость авторов: карточки артистов больше не сжимаются и остаются полностью видимыми и прокручиваемыми при вводе запроса.', + 'Улучшенное поведение интерфейса: плавающая кнопка настроек и нижняя панель скрываются при открытии клавиатуры, добавлен свайп для скрытия клавиатуры при прокрутке.', + ], + ), PrismaChange( version: '3.5.1', title: 'Улучшение панели поиска и фильтров авторов в Liquid Glass', diff --git a/lib/features/artists/presentation/artists_screen.dart b/lib/features/artists/presentation/artists_screen.dart index 919f65a..6062cd1 100644 --- a/lib/features/artists/presentation/artists_screen.dart +++ b/lib/features/artists/presentation/artists_screen.dart @@ -97,7 +97,11 @@ class _ArtistsScreenState extends ConsumerState { void initState() { super.initState(); _scroll.addListener(() { - if (_scroll.position.extentAfter < 500) _loadMore(); + if (_scroll.hasClients && + _scroll.position.hasContentDimensions && + _scroll.position.extentAfter < 500) { + _loadMore(); + } }); } @@ -128,6 +132,7 @@ class _ArtistsScreenState extends ConsumerState { return AdaptiveScaffold( title: 'Artists', + resizeToAvoidBottomInset: false, actions: [ IconButton( tooltip: 'Синхронизация Pawchive', @@ -252,6 +257,8 @@ class _ArtistsScreenState extends ConsumerState { : 1; return GridView.builder( controller: _scroll, + keyboardDismissBehavior: + ScrollViewKeyboardDismissBehavior.onDrag, padding: const EdgeInsets.fromLTRB(16, 10, 16, 18), gridDelegate: @@ -594,6 +601,7 @@ class _ArtistsHeader extends StatelessWidget { child: TextField( controller: searchController, textInputAction: TextInputAction.search, + autocorrect: false, style: TextStyle( fontSize: 14, color: isDark ? Colors.white : const Color(0xFF0F172A), diff --git a/lib/shared/widgets/adaptive_scaffold.dart b/lib/shared/widgets/adaptive_scaffold.dart index 21ccf56..d2ed541 100644 --- a/lib/shared/widgets/adaptive_scaffold.dart +++ b/lib/shared/widgets/adaptive_scaffold.dart @@ -9,6 +9,7 @@ class AdaptiveScaffold extends StatelessWidget { this.titleWidget, this.actions = const [], this.floatingActionButton, + this.resizeToAvoidBottomInset = false, super.key, }); @@ -17,11 +18,13 @@ class AdaptiveScaffold extends StatelessWidget { final Widget body; final List actions; final Widget? floatingActionButton; + final bool resizeToAvoidBottomInset; @override Widget build(BuildContext context) { if (Responsive.isMobile(context)) { return Scaffold( + resizeToAvoidBottomInset: resizeToAvoidBottomInset, appBar: AppBar( title: titleWidget ?? Text(title), actions: actions, @@ -35,6 +38,7 @@ class AdaptiveScaffold extends StatelessWidget { ); } return Scaffold( + resizeToAvoidBottomInset: resizeToAvoidBottomInset, appBar: AppBar(title: titleWidget ?? Text(title), actions: actions), body: body, floatingActionButton: floatingActionButton, diff --git a/lib/shared/widgets/app_shell.dart b/lib/shared/widgets/app_shell.dart index 86acd16..f166680 100644 --- a/lib/shared/widgets/app_shell.dart +++ b/lib/shared/widgets/app_shell.dart @@ -352,19 +352,23 @@ class _MobileShell extends StatelessWidget { ? location == '/' : location.startsWith(item.location), ); - final bottomInset = 76.0 + MediaQuery.paddingOf(context).bottom; + final isKeyboardOpen = MediaQuery.viewInsetsOf(context).bottom > 0; + final bottomInset = isKeyboardOpen + ? 0.0 + : 76.0 + MediaQuery.paddingOf(context).bottom; return Scaffold( extendBody: true, body: MediaQuery( data: MediaQuery.of(context).copyWith( + viewInsets: MediaQuery.of(context).viewInsets.copyWith(bottom: 0), padding: MediaQuery.of(context).padding.copyWith( bottom: bottomInset, ), ), child: child, ), - floatingActionButton: location == '/settings' + floatingActionButton: (location == '/settings' || isKeyboardOpen) ? null : Padding( padding: const EdgeInsets.only(bottom: 0, right: 2), @@ -374,12 +378,15 @@ class _MobileShell extends StatelessWidget { ), ), floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, - bottomNavigationBar: _LiquidGlassBottomBar( - selectedIndex: selected < 0 ? 0 : selected, - onDestinationSelected: (index) => context.go(items[index].location), - items: items, - ru: ru, - ), + bottomNavigationBar: isKeyboardOpen + ? null + : _LiquidGlassBottomBar( + selectedIndex: selected < 0 ? 0 : selected, + onDestinationSelected: (index) => + context.go(items[index].location), + items: items, + ru: ru, + ), ); } } diff --git a/pubspec.yaml b/pubspec.yaml index fdc2b5f..edacd77 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: gel_rule_app description: Local backend/core layer for a Flutter booru browser app. publish_to: "none" -version: 3.5.1+77 +version: 3.5.2+78 environment: sdk: ">=3.3.0 <4.0.0"