Anonymous
Android Status Bar Coverp Issus в Futts
Сообщение
Anonymous » 19 июн 2025, 16:11
Я строю приложение в Flutter, панель приложений перекрывает строку состояния в основном на OnePlus и Motorola Mobiles. Я делюсь файлами кода моего проекта
homeview
Код: Выделить всё
class HomeView extends GetView { const HomeView({super.key});
@override Widget build(BuildContext context) {
return AnnotatedRegion(
value: SystemUiOverlayStyle.light.copyWith(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.light,
),
child: SafeArea(
child: Scaffold(
appBar: AppBar(
title: Obx(() {
if (controller.tabIndex.value == 0) {
return DropdownButton(
isExpanded: false,
dropdownColor: AppColors.kWhiteColor,
value: controller.selectedLocationId.value,
onChanged: (selectedValue) {
controller.selectedLocationId.value =
selectedValue.toString();
},
items: controller.locationDropDownMenuItem.value,
iconEnabledColor: AppColors.kBlackColor,
underline: Container(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: AppColors.kBlackColor,
),
);
} else {
return Text('Flutter App');
}
}),
actions: [
appBarAActionItem(
iconData: Icons.account_balance_wallet_outlined,
onTap: () => Get.toNamed(Routes.WALLET),
),
appBarAActionItem(
iconData: Icons.notifications_none_outlined,
onTap: () => Get.toNamed(Routes.NOTIFICATIONS),
),
],
),
drawer: NavigationDrawerWidget(),
body: Obx(
() => IndexedStack(
index: controller.tabIndex.value,
children: [
MeetingRoomView(
locationId: controller.selectedLocationId.value,
),
TicketView(),
],
),
),
bottomNavigationBar: Obx(
() => BottomNavigationBar(
onTap: controller.changeTabIndex,
currentIndex: controller.tabIndex.value,
unselectedItemColor: AppColors.kBlackColor,
selectedItemColor: AppColors.kDodgerBlueColor,
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.white,
elevation: 0,
showSelectedLabels: true,
showUnselectedLabels: true,
items: [
bottomNavigationBarItem(
Icons.meeting_room_outlined,
'Meeting Room',
),
bottomNavigationBarItem(
Icons.support_agent_outlined,
'Tickets',
),
],
),
),
),
),
); }
bottomNavigationBarItem(IconData icon, String label) {
return BottomNavigationBarItem(
icon: Icon(icon),
label: label,
); }
appBarAActionItem({
required IconData iconData,
required VoidCallback onTap, }) {
return Padding(
padding: EdgeInsets.only(
right: 20,
bottom: 12,
),
child: GestureDetector(
onTap: onTap,
child: Icon(
iconData,
color: AppColors.kBlackColor,
),
),
); } }
файл манифеста Android
Код: Выделить всё
< /code>
styles.xml
@drawable/launch_background
true
@android:color/transparent
?android:colorBackground
true
@android:color/transparent
Я также добавляю изображение проблемы и требуемое изображение для лучшего понимания моей проблемы.
Изображение проблемы
Подробнее здесь:
https://stackoverflow.com/questions/796 ... in-flutter
1750338688
Anonymous
Я строю приложение в Flutter, панель приложений перекрывает строку состояния в основном на OnePlus и Motorola Mobiles. Я делюсь файлами кода моего проекта [b] homeview [/b] [code]class HomeView extends GetView { const HomeView({super.key}); @override Widget build(BuildContext context) { return AnnotatedRegion( value: SystemUiOverlayStyle.light.copyWith( statusBarColor: Colors.transparent, statusBarIconBrightness: Brightness.light, ), child: SafeArea( child: Scaffold( appBar: AppBar( title: Obx(() { if (controller.tabIndex.value == 0) { return DropdownButton( isExpanded: false, dropdownColor: AppColors.kWhiteColor, value: controller.selectedLocationId.value, onChanged: (selectedValue) { controller.selectedLocationId.value = selectedValue.toString(); }, items: controller.locationDropDownMenuItem.value, iconEnabledColor: AppColors.kBlackColor, underline: Container(), style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, color: AppColors.kBlackColor, ), ); } else { return Text('Flutter App'); } }), actions: [ appBarAActionItem( iconData: Icons.account_balance_wallet_outlined, onTap: () => Get.toNamed(Routes.WALLET), ), appBarAActionItem( iconData: Icons.notifications_none_outlined, onTap: () => Get.toNamed(Routes.NOTIFICATIONS), ), ], ), drawer: NavigationDrawerWidget(), body: Obx( () => IndexedStack( index: controller.tabIndex.value, children: [ MeetingRoomView( locationId: controller.selectedLocationId.value, ), TicketView(), ], ), ), bottomNavigationBar: Obx( () => BottomNavigationBar( onTap: controller.changeTabIndex, currentIndex: controller.tabIndex.value, unselectedItemColor: AppColors.kBlackColor, selectedItemColor: AppColors.kDodgerBlueColor, type: BottomNavigationBarType.fixed, backgroundColor: Colors.white, elevation: 0, showSelectedLabels: true, showUnselectedLabels: true, items: [ bottomNavigationBarItem( Icons.meeting_room_outlined, 'Meeting Room', ), bottomNavigationBarItem( Icons.support_agent_outlined, 'Tickets', ), ], ), ), ), ), ); } bottomNavigationBarItem(IconData icon, String label) { return BottomNavigationBarItem( icon: Icon(icon), label: label, ); } appBarAActionItem({ required IconData iconData, required VoidCallback onTap, }) { return Padding( padding: EdgeInsets.only( right: 20, bottom: 12, ), child: GestureDetector( onTap: onTap, child: Icon( iconData, color: AppColors.kBlackColor, ), ), ); } } [/code] [b] файл манифеста Android [/b] [code] < /code> styles.xml @drawable/launch_background true @android:color/transparent ?android:colorBackground true @android:color/transparent [/code] Я также добавляю изображение проблемы и требуемое изображение для лучшего понимания моей проблемы. [b] Изображение проблемы [/b] Подробнее здесь: [url]https://stackoverflow.com/questions/79670210/android-statusbar-overlap-issue-in-flutter[/url]