Anonymous
Как избежать дополнительного пространства, которое идет ниже нижнего запчана в приложениях Flutter iOS
Сообщение
Anonymous » 19 июн 2025, 10:16
Проблема существует только в iOS, а не в Android, Bottombanvar in iOS телефонов добавляет дополнительную прокладку под нижним делом, по этому поводу, кажется, имеет большую высоту, чем дизайн пользовательского интерфейса, как решить эту проблему. Скриншот < /p>
Код: Выделить всё
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, result) {
if (!didPop) {
final focus = FocusScope.of(context);
if (!focus.hasPrimaryFocus && focus.focusedChild != null) {
focus.unfocus(); // Closes the keyboard
}
}
},
child: Scaffold(
backgroundColor: context.color.grayScale.grey12,
extendBody: true,
resizeToAvoidBottomInset: false,
body: _widgetOptions.elementAt(_selectedIndex),
floatingActionButton: keyboardIsOpened
? null
: SizedBox(
width: 52,
height: 52,
child: FloatingActionButton(
heroTag: 'searchgymButton_${DateTime.now().toString()}',
tooltip: 'search',
isExtended: true,
onPressed: () {
_onItemTapped(2);
},
child: SvgPicture.asset(
AssetPaths.home_search,
),
backgroundColor: context.color.primary.cyan500,
shape: CircleBorder(),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomAppBar(
height: 80,
surfaceTintColor: context.color.grayScale.grey11,
notchMargin: 8,
// padding: EdgeInsets.all(0),
color: context.color.grayScale.grey11,
shape: const CircularNotchedRectangle(),
clipBehavior: Clip.antiAlias,
child: Container(
color: Colors.transparent,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildNavItem(0, AssetPaths.home2, 'my_gyms'.tr()),
_buildNavItem(1, AssetPaths.scanner, 'nfc_check'.tr()),
SizedBox(
width: 50,
),
_buildNavItem(3, AssetPaths.support, 'support'.tr()),
_buildNavItem(4, AssetPaths.profile, 'profile'.tr()),
],
),
),
),
),
);
}
Подробнее здесь:
https://stackoverflow.com/questions/796 ... -flutter-i
1750317414
Anonymous
Проблема существует только в iOS, а не в Android, Bottombanvar in iOS телефонов добавляет дополнительную прокладку под нижним делом, по этому поводу, кажется, имеет большую высоту, чем дизайн пользовательского интерфейса, как решить эту проблему. Скриншот < /p> [code]return PopScope( canPop: false, onPopInvokedWithResult: (didPop, result) { if (!didPop) { final focus = FocusScope.of(context); if (!focus.hasPrimaryFocus && focus.focusedChild != null) { focus.unfocus(); // Closes the keyboard } } }, child: Scaffold( backgroundColor: context.color.grayScale.grey12, extendBody: true, resizeToAvoidBottomInset: false, body: _widgetOptions.elementAt(_selectedIndex), floatingActionButton: keyboardIsOpened ? null : SizedBox( width: 52, height: 52, child: FloatingActionButton( heroTag: 'searchgymButton_${DateTime.now().toString()}', tooltip: 'search', isExtended: true, onPressed: () { _onItemTapped(2); }, child: SvgPicture.asset( AssetPaths.home_search, ), backgroundColor: context.color.primary.cyan500, shape: CircleBorder(), ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, bottomNavigationBar: BottomAppBar( height: 80, surfaceTintColor: context.color.grayScale.grey11, notchMargin: 8, // padding: EdgeInsets.all(0), color: context.color.grayScale.grey11, shape: const CircularNotchedRectangle(), clipBehavior: Clip.antiAlias, child: Container( color: Colors.transparent, child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ _buildNavItem(0, AssetPaths.home2, 'my_gyms'.tr()), _buildNavItem(1, AssetPaths.scanner, 'nfc_check'.tr()), SizedBox( width: 50, ), _buildNavItem(3, AssetPaths.support, 'support'.tr()), _buildNavItem(4, AssetPaths.profile, 'profile'.tr()), ], ), ), ), ), ); [/code] } Подробнее здесь: [url]https://stackoverflow.com/questions/79671664/how-to-avoid-the-extra-space-which-is-coming-below-the-bottomappbar-in-flutter-i[/url]