Search code examples
stringflutterdarttexteditingcontroller

How can I use controller as a string?


I want to pass the controller as a String in an argument but the controller is of TextEditingController type. How can I change the type of controller as a String?


Solution

  • You need to access the text property.

    TextEditingController.text
    

    Replace it with your controller's name. i.e

    usernameController.text