Answers for "how to style textfield hinttext in flutter"

2

textfield style flutter

TextField(
   cursorHeight: 20,
   autofocus: false,
   controller: TextEditingController(text: "Initial Text here"),
   decoration: InputDecoration(
      labelText: 'Enter your username',
      hintText: "Enter your Name",
      prefixIcon: Icon(Icons.star),
      suffixIcon: Icon(Icons.keyboard_arrow_down),
      contentPadding: const EdgeInsets.symmetric(vertical: 10,horizontal: 10),
      border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(30),
          borderSide: BorderSide(color: Colors.grey, width: 2),
      ),
      enabledBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(30),
        borderSide: BorderSide(color: Colors.grey, width: 1.5),
     ),
     focusedBorder: OutlineInputBorder(
        gapPadding: 0.0,
        borderRadius: BorderRadius.circular(30),
        borderSide: BorderSide(color: Colors.red, width: 1.5),
     ),
   ),
)
Posted by: Guest on January-20-2022
1

textfield style flutter

TextField(
  cursorHeight: 25,
  autofocus: false,
  decoration: InputDecoration(
  	contentPadding: const EdgeInsets.symmetric(vertical: 10,horizontal: 10),
  	border: OutlineInputBorder(),
  	labelText: 'Enter your username',
  	hintText: "Enter your Name"
  ),
)
Posted by: Guest on January-20-2022

Code answers related to "how to style textfield hinttext in flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language