title: Text('Change TextField Border Color'), ), body: Center( child: Padding( padding: EdgeInsets.all(20.0), child: TextField( decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.red), // 设置边框颜色 ), ), ), ), ), ), ); } } ...
border: Border.all( color: const Color(0xffff0000), width: 2.0, ), color: const Color(0xFFfff000), image: DecorationImage( image: NetworkImage('http://pic33.nipic.com/20131007/13639685_123501617185_2.jpg'), fit: BoxFit.fill ), borderRadius: BorderRadius.all(Radius.circular(10.0)) ), ...
二、播放器页面对导航栏状态栏的修改设置 @overrideWidgetbuild(BuildContextcontext){super.build(context);SystemUiOverlayStylevalue;if(Platform.isAndroid){value=SystemUiOverlayStyle(statusBarColor:Colors.transparent,/// 安卓系统状态栏存在底色,所以需要加这个systemNavigationBarColor:Colors.transparent,systemNavigat...
rotationZ(0.1), ), --- //返回Decoration对象 Decoration buildBoxDecoration() { return new BoxDecoration( color: const Color(0xfffce5cd), //设置Border属性给容器添加边框 border: new Border.all( //为边框添加颜色 color: const Color(0xff6d9eed), //为边框宽度 width: 8.0, ) ); } Decoration...
6)theme.primaryColor:单独设置导航栏的背景色。 示例代码: 代码语言:javascript 复制 import'package:flutter/material.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget{@override Widgetbuild(BuildContext context){returnMaterialApp(title:'Material Components',home:FirstPage(),routes:<String,...
(hintText:"请填写您宝贵的意见",border:OutlineInputBorder(borderRadius:BorderRadius.circular(5.0),borderSide:BorderSide()),),obscureText:false,//是否是密码cursorColor:Colors.red,//光标颜色//内容改变的回调onChanged:(text){print('change $text');},//内容提交(按回车)的回调onSubmitted:(text){...
borderSide: BorderSide()), ), obscureText: false, //是否是密码 cursorColor: Colors.red, //光标颜色 //内容改变的回调 onChanged: (text) { print('change $text'); }, //内容提交(按回车)的回调 onSubmitted: (text) { print('submit $text'); ...
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.bottomSheet()来显示BottomSheet,通过Get.back()实现路由返回,通过Get.changeTheme(ThemeData.dark())切换皮肤主题,通过Get.isDarkMode判断主题样式。 ElevatedButton(onPressed:(){Get.bottomSheet(Container(color:Get.isDarkMode?Colors.black12:Colors.white,height:200,child:Column(children:[ListTile...
children: <Widget>[//SnackBar 需要提供一个包含 context,但是 context 不能是 Scaffold 节点下的 context,所以需要通过 Builder 包裹一层Builder(builder: (context) => RaisedButton(onPressed: () => _changeValue(context), child: Text('修改当前值'))), ...