ArgumentError (Invalid argument: Instance of 'TextEditingController')

Solution 1:

This line:

Firestore.instance.collection('reg').add({'name':controllerName})

should be replaced with:

Firestore.instance.collection('reg').add({'name':controllerName.text})

Also, you should probably give your TextField an initial value of an empty string so that it can't be null.

Solution 2:

controllerName is not a String,

controllerName.text

use that