Widget_buildBottomBar(){returnCustomAnimatedBottomBar(containerHeight:70,backgroundColor:Colors.black,selectedIndex:_currentIndex,showElevation:true,itemCornerRadius:24,curve:Curves.easeIn,onItemSelected:(index)=>setState(()=>_currentIndex=index),items:<BottomNavyBarItem>[BottomNavyBarItem(icon:Icon(Icons....
( backgroundColor: Colors.blue, // 设置底部菜单的背景颜色为蓝色 items: [ BottomNavigationBarItem( icon: Icon(Icons.home), label: 'Home', ), BottomNavigationBarItem( icon: Icon(Icons.search), label: 'Search', ), BottomNavigationBarItem( icon: Icon(Icons.person), label: 'Profile'...
我们先创建一个 icons.dart 文件。 import'package:flutter/material.dart';classFMIconVCextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnContainer(child:Scaffold(appBar:AppBar(title:Text("Icon",),backgroundColor:Colors.lightBlue,),body:Container(child:_column(),),),);}Column_column...
Flutter AppBar组件中的常见属性: import'package:flutter/material.dart';classAppBardemoPageextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnScaffold(appBar:AppBar(backgroundColor:Colors.red,leading:IconButton(icon:Icon(Icons.menu),tooltip:"Search",onPressed:(){print('menu Pressed');}...
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Boss直聘', theme: ThemeData( primaryIconTheme: IconThemeData(color: Colors.white), //按钮主题 brightness: Bri...
5. backgroundColor: Colors.red, //导航栏和状态栏的的颜色 6. elevation: 10, //阴影的高度 7.bottom :导航栏下面显示的widget 8.brightness :状态栏的亮度 9. iconTheme,左侧图表的样式 12. toolbarOpacity: 0.5, //整个导航栏的不透明度
color: Colors.white, ), child: FloatingActionButton( child: Icon(Icons.add), onPressed: () { setState(() {//改变状态this._currentIndex = 2; }); }, backgroundColor:this._currentIndex == 2 ?Colors.red : Colors.yellow, ), ), ...
flex_color_scheme: ^7.1.2 第二步:打开样式定制器 https://rydmike.com/flexcolorscheme/themesplayground-v7-1/ 第三步:复制样式代码 lib/main.dart // This widget is the root of your application. @override Widget build(BuildContext context) { ...
());Get.back();},),ListTile(leading:Icon(Icons.wb_sunny,color:Get.isDarkMode?Colors.white:Colors.black),title:Text("黑夜模式",style:TextStyle(color:Get.isDarkMode?Colors.white:Colors.black)),onTap:(){Get.changeTheme(ThemeData.dark());Get.back();},)],),));},child:constText("...
backgroundColor:APP bar 的颜色,默认值为 ThemeData.primaryColor。改值通常和下面的三个属性一起使用; brightness:App bar 的亮度,有白色和黑色两种主题,默认值为 ThemeData.primaryColorBrightness; iconTheme:App bar 上图标的颜色、透明度、和尺寸信息。默认值为 ThemeData.primaryIconTheme; ...