Skip to content

Instantly share code, notes, and snippets.

View anshd258's full-sized avatar
:electron:

anshd258 anshd258

:electron:
  • Delhi, India
View GitHub Profile
TextField(
decoration: InputDecoration(
hintText: "your-name",
),
),
TextField(
minLines: 2,
maxLines: 5,
),
TextField(
obscureText: true,
obscuringCharacter: "/",
maxLength: 10,
),
TextField(
decoration: InputDecoration(
suffix: Text(
"suffix.",
style: TextStyle(
color: Colors.black,
),
),
labelText: "NAME",
hintText: "your-name",
TextField(
decoration: InputDecoration(
prefix: Text(
"Mr.",
style: TextStyle(
color: Colors.black,
),
),
labelText: "NAME",
hintText: "your-name",
TextField(
decoration: InputDecoration(
labelText: "NAME",
),
),
TextField(
cursorColor: Colors.redAccent.shade400,
cursorHeight: 25,
cursorWidth: 10,
cursorRadius: Radius.circular(20),
controller: alpa,
showCursor: true,
enabled: trigger,
keyboardType: TextInputType.name,
inputFormatters: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(alpa.text),
Center(
child: TextField(
cursorColor: Colors.redAccent.shade400,
cursorHeight: 25,
cursorWidth: 10,
cursorRadius: Radius.circular(20),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(alpa.text),
Center(
child: TextField(
controller: alpa,
),
),
ElevatedButton(
class _MyWidgetState extends State<MyWidget> {
TextEditingController alpa = TextEditingController();
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "textfield",
home: Scaffold(
appBar: AppBar(
leading: BackButton(),