US Office

1176 Shadeville Rd, Crawfordville Florida 32327, USA

 +1 (850) 780-1313

India Office

Office No 405, Kabir Shilp, Opp. Kansar Hotel, Opp. Landmark, Kudasan, Gandhinagar, Gujarat 382421

[email protected]

How to Disable TextField In Flutter?

How to Disable TextField In Flutter

How to Disable TextField In Flutter?

TextField Widget in Flutter Application is used to get data from users and store that data into the database. So in this article, we will be going through How to Disable TextField In Flutter.

How to Disable TextField In Flutter?

  • TextField now has enabled property. where you can just disable the TextField like
    new TextField(
        enabled: false, 

    TextField and TextFormField both have an argument called enabled. You can control it using a boolean variable. enabled=true means it will act as an editing text field whereas enabled=false will Disable the TextField Widget.

  • Create AlwaysDisabledFocusNode and pass it to the focusNode property of a TextField Widget.
    class AlwaysDisabledFocusNode extends FocusNode {
      bool get hasFocus => false;

    then you can also use this, as shown below:

    new TextField(
        enableInteractiveSelection: false, // will disable paste operation
        focusNode: new AlwaysDisabledFocusNode(),

User can also try like a below:

    enableInteractiveSelection: false,
    focusNode: FocusNode(),

enableInteractiveSelection will disable content selection of TextField .

Similar to disabled in HTML

    enable: false

So you can also make it happen like below:

      absorbing: true,  //To disable from touch use false while **true** for otherwise
      child: Your WidgetsName

I have used a combination of readOnly and enableInteractiveSelection properties to achieve the desired behavior on the TextField Widget.

  readOnly: true,
  enableInteractiveSelection: true,
  onTap: () {

Next up we will learn flutter textfield disable keyboard, flutter disable button, textfield flutter, flutter textfield not working, flutter textfield overflow, flutter textfield set value, flutter textfield default text, textfield flutter documentation, etc.

So Stay tuned:)


So that’s it for today, Hope you have enhanced your knowledge of flutter.

Keep Learning !!! Keep Fluttering !!!

Still, need Support for Flutter Development? Do let us know. is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget GuideFlutter ProjectsCode libs and etc. is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

Post a Comment