fix(artists): resolve double keyboard inset and white square bug during search (v3.5.2)
This commit is contained in:
@@ -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<Widget> 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,
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user