设计:
以上设计的Flutter代码
nhaq1z211#
你可以使用这个代码:
class InputFil extends StatelessWidget{ String Labletext; IconData RightIcon; IconButton ?LeftIcon; bool ShowPass; TextEditingController ?Control; TextInputType KeyType; final validator; InputFil({required this.Labletext,required this.RightIcon, this.LeftIcon,required this.ShowPass, this.Control,required this.KeyType,this.validator,}); @override Widget build(BuildContext context) { return TextFormField( controller: Control, obscureText: ShowPass, validator: validator, style: TextStyle(color: Colors.white,fontSize: 15), decoration: InputDecoration( enabledBorder: OutlineInputBorder( borderSide: BorderSide(width: 1.5, color: Colors.white), ), ////your answer. focusedBorder: OutlineInputBorder( borderSide: BorderSide(width: 1.5, color: Colors.white), ), prefixIcon: Icon(RightIcon,color: Colors.white,), contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0), labelText: Labletext, suffixIcon : LeftIcon, labelStyle: TextStyle(color: Colors.white), iconColor: Colors.white, suffixIconColor: Colors.white, prefixIconColor: Colors.white, border: OutlineInputBorder(borderRadius: BorderRadius.circular(10.0)), ), keyboardType: KeyType, ); } }
1条答案
按热度按时间nhaq1z211#
你可以使用这个代码: