Created
April 24, 2022 10:47
-
-
Save SuvidhaMalaviya/d7c9386c9e93f93d930e68242ecb8580 to your computer and use it in GitHub Desktop.
how to make custom TextField in flutter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget getCustomTextField( | |
TextEditingController _controller, String hintText) { | |
return Container( | |
height: 65, | |
child: Padding( | |
padding: EdgeInsets.only(top: 8, bottom: 8), | |
child: TextFormField( | |
controller: _controller, | |
decoration: InputDecoration( | |
isDense: true, | |
fillColor: Colors.grey, | |
filled: true, | |
focusedBorder: OutlineInputBorder( | |
borderRadius: BorderRadius.all(Radius.circular(10)), | |
borderSide: BorderSide(color: Colors.grey, width: 1), | |
), | |
enabledBorder: OutlineInputBorder( | |
borderRadius: BorderRadius.all(Radius.circular(10)), | |
borderSide: BorderSide(color: Colors.grey, width: 1), | |
), | |
border: OutlineInputBorder( | |
borderRadius: BorderRadius.all(Radius.circular(10)), | |
borderSide: BorderSide(color: Colors.grey, width: 1), | |
), | |
disabledBorder: OutlineInputBorder( | |
borderRadius: BorderRadius.all(Radius.circular(10)), | |
borderSide: BorderSide(color: Colors.grey, width: 1), | |
), | |
suffixIcon: Image.asset( | |
Icons.help, | |
color: Colors.blue, | |
height: 10, | |
width: 10, | |
), | |
hintText: hintText, | |
hintStyle: TextStyle( | |
fontSize: getFontSize(16), | |
color: hintColor, | |
letterSpacing: 0.22, | |
), | |
), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment