static const white=Color(0xffffffff); static const black=Color(0xff000000); } class LoginPage extends StatelessWidget with CommonValidator { const LoginPage({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: AppColors.black, // good ...
复制 constSnackBar({Key key,@requiredthis.content,// 提示信息this.backgroundColor,// 背景色this.action,// SnackBar 尾部的按钮,用于一些回退操作等this.duration=_kSnackBarDisplayDuration,// 停留的时长,默认 4000msthis.animation,// 进出动画}) 例如我们需要实现一个功能,修改某个值,修改后给用户一个提...
red, // 按钮的颜色 默认:ThemeData.accentColor backgroundColor: Colors.yellow, // 有输入焦点 按钮的颜色 默认:ThemeData.focusColor focusColor: Colors.tealAccent, // 指针悬停时 按钮的颜色 默认:ThemeData.hoverColor hoverColor: Colors.white, // 点击时的水波纹颜色 默认:如果为null,使用FloatingAction...
// Add your onPressed code here! }, child: const Icon(Icons.navigation), backgroundColor: Colors.green, ), ); } } 显示效果: <!--<img src="https://inews.gtimg.com/newsapp\_ls/0/13897745469/0.png" style="width:200px" />--> simulator screen shot - iphone 12 pro max - 2021-...
@overrideWidgetbuild(BuildContextcontext){super.build(context);SystemUiOverlayStylevalue;if(Platform.isAndroid){value=SystemUiOverlayStyle(statusBarColor:Colors.transparent,/// 安卓系统状态栏存在底色,所以需要加这个systemNavigationBarColor:Colors.transparent,systemNavigationBarIconBrightness:Brightness.light,status...
Container(color:Theme.of(context).secondaryHeaderColor,child:Text('Text with a background color',style:Theme.of(context).textTheme.headline6,),); Navigator也用了这种方式,我们经常使用 Navigator 的 of 方法来 push 或者 pop 路由。MediaQuery也用这种方式让开发者可以很快捷的获取屏幕相关信息,尺寸、方向...
backgroundColor: Colors.white,///填充布局body: Container( padding: EdgeInsets.all(20), width:double.infinity, height:double.infinity, child: Column( children: [///层叠布局将进度与文字叠在一起Stack(///子Widget居中alignment: Alignment.center, ...
router( color: Colors.white, routerConfig: router, ), ); } } class HomePage extends StatelessWidget { const HomePage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: const Color(0xFF0000FF), title: const ...
backgroundColor:Color(0xfffbfbfb), title:Text('Awesome Notificaitons needs your permission', textAlign:TextAlign.center, maxLines:2, style:TextStyle(fontSize:22, fontWeight:FontWeight.w600), ), content:Column( mainAxisSize:MainAxisSize.min, ...
// add custom css this.webViewController.injectStyleCode(""" body { background-color: #3c3c3c !important; } """); this.webViewController.injectStyleFile("https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"); } @override void onLoadError(String url, int code, Stri...