import'package:flutter/cupertino.dart';import'package:flutter/material.dart';import'package:flutter_screenutil/flutter_screenutil.dart';import'package:picturebook/pages/test/test_page.dart';import'../color_utils.dart';classPNavigationBar{staticOverlayEntry? overlayEntry;staticshow(BuildContext context, Ta...
import'package:flutter/cupertino.dart';import'package:flutter/material.dart';import'package:flutter_screenutil/flutter_screenutil.dart';import'package:picturebook/pages/test/test_page.dart';import'../color_utils.dart';classPNavigationBar{staticOverlayEntry? overlayEntry;staticshow(BuildContext context, Ta...
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( systemNavigationBarColor: Colors.red, // 设置导航栏颜色 )); 运行应用程序:使用flutter run命令来运行Flutter应用程序,并查看导航栏颜色的更改效果。 需要注意的是,以上步骤只适用于Android平台。在iOS平台上,由于系统限制,无法直接更改导航栏颜色。 推荐的...
二、播放器页面对导航栏状态栏的修改设置 @overrideWidgetbuild(BuildContextcontext){super.build(context);SystemUiOverlayStylevalue;if(Platform.isAndroid){value=SystemUiOverlayStyle(statusBarColor:Colors.transparent,/// 安卓系统状态栏存在底色,所以需要加这个systemNavigationBarColor:Colors.transparent,systemNavigat...
(bottomNavigationBar:NavigationBar(onDestinationSelected:(intindex){setState((){currentPageIndex=index;});},indicatorColor:Colors.black,selectedIndex:currentPageIndex,destinations:const<Widget>[NavigationDestination(selectedIcon:Icon(Icons.home),icon:Icon(Icons.home_outlined),label:"Home",),Navigation...
bottomNavigationBar: NavigationBar( //菜单组 destinations: navigationList, //当前选中的 selectedIndex:_currentIndex , //选择点击事件 onDestinationSelected: (int index){ setState(() { _currentIndex = index; }); }, //背景颜色 backgroundColor: Colors.white, ...
BottomNavigationBar 是底部导航条,可以让我们定义底部Tab切换,bottomNavigationBar是 Scaffold组件的参数。 BottomNavigationBar 常见的属性 itemsList 底部导航条按钮集合 iconSizeicon currentIndex 默认选中第几个 onTap选中变化回调函数 fixedColor选中的颜色
BottomNavigationBar 构造函数: 代码语言:javascript 代码运行次数:0 复制 BottomNavigationBar({Key?key,required List<BottomNavigationBarItem>items,ValueChanged<int>?onTap,int currentIndex=0,double?elevation,BottomNavigationBarType?type,Color?fixedColor,Color?backgroundColor,double iconSize=24.0,Color?selected...
statusBarColor: Colors.transparent, // transparent status bar systemNavigationBarColor: Colors.black, // navigation bar color statusBarIconBrightness: Brightness.dark, // status bar icons' color systemNavigationBarIconBrightness: Brightness.dark, //navigation bar icons' color ...
statusBarColor: Colors.transparent,// 去除状态栏遮罩statusBarIconBrightness: Brightness.dark,// 状态栏图标字体颜色systemNavigationBarColor: Color.fromARGB(255,242,247,251),// 底部导航栏颜色) ), colorScheme:constColorScheme.light( surface: Color.fromARGB(255,242,247,251),// 和底部导航栏保持一致...