dart import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('Remove TextField Underline'), ), body: Center( child: TextFi...
To remove the border or underline of a TextField or TextInputField, you need to create an InputDecoration where the border is set to InputBorder.none. The InputDecoration has some arguments for setting the border based on the state of the field. Setting only the border argument should be en...
this.decoration = const InputDecoration(), //输入框的装饰器,用来修改外观 TextInputType keyboardType, //设置输入类型,不同的输入类型键盘不一样 this.textInputAction, //用于控制键盘动作(一般位于右下角,默认是完成) this.textCapitalization = TextCapitalization.none, this.style, //输入的文本样式 this....
InputDecoration({this.icon,//位于装饰器外部和输入框前面的图片this.labelText,//用于描述输入框,例如这个输入框是用来输入用户名还是密码的,当输入框获取焦点时默认会浮动到上方,this.labelStyle,// 控制labelText的样式,接收一个TextStyle类型的值this.helperText,//辅助文本,位于输入框下方,如果errorText不为空...
TextField( decoration: InputDecoration( labelText: "请输入用户名", prefixIcon: Icon(Icons.person), // 未获得焦点下划线设为灰色 enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey), ), //获得焦点下划线设为蓝色 focusedBorder: UnderlineInputBorder( borderSide: BorderSide(...
TextDecoration.overline,(lineThrough 删除线)(underline 下划线) //波浪线 decorationStyle: TextDecorationStyle.wavy (dashed)(dotted) //字重 fontWeight: FontWeight.w700 style: TextStyle(inherit: false,fontSize: 22.0,color: Color(0xFF000000),/*fontStyle: FontStyle.italic,*/letterSpacing: 2.0,/*dec...
JFWidth(14)) :JTextFCMake(JFFont(15), rgb(28, 218, 159))]; valueL.text = [NSStri...
this.semanticCounterText, this.alignLabelWithHint, // 覆盖将标签与 TextField 的中心对齐 }) const InputDecoration.collapsed({ @required this.hintText, this.hasFloatingPlaceholder = true, this.hintStyle, this.filled = false, this.fillColor, ...
decoration:InputDecoration(border:OutlineInputBorder(),hintText:'请输入姓名',prefixIcon:Icon(Icons.person),suffixIcon:Icon(Icons.remove_red_eye),icon:Icon(Icons.person),// 在输入框外面添加一个 icon), 其他属性 labelText 用于描述输入框,例如这个输入框是用来输入用户名还是密码的,当输入框获取焦点时默...
return TextField(decoration: InputDecoration( labelText: '用户名:', labelStyle: TextStyle(color: Colors.purple), helperText: '请输入手机号或邮箱!', helperStyle: TextStyle(color: Colors.teal))); hintText 为文本框默认提示信息,若设置 labelText,则 TextField 在未获取焦点时优先展示 labelText;hint...