I would input text into a TextField() and then use a GestureDetector to add the text. The problem was on the phone; it would not automatically close the keyboard. The simple solution was to call:
FocusManager.instance.primaryFocus?.unfocus();
My Code:
child: TextField( onChanged: (value) { // setState(() { // _comment = value; // }); _comment = value; }, decoration: InputDecoration( filled: true, fillColor: const Color.fromARGB( 255, 192, 192, 192), border: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide.none), hintText: 'Write a comment'), ), ), ), if (isLoggedIn()) GestureDetector( onTap: () async { if (!(await appIsOnline())) { return; } // Validate returns true if the form is valid, or false otherwise. if (_comment != '') { await _prayerRequestCubit .postPrayerRequestComment( prayerId: widget .prayer.prayerRequestId, memberEmail: getMemberEntityIfLoggedIn() .memberEmail .toString(), text: _comment); _comment = ''; // ignore: use_build_context_synchronously // Navigator.pop(context); // ignore: use_build_context_synchronously setState(() {}); FocusManager.instance.primaryFocus ?.unfocus(); } }, child: const Icon(Icons.send)) else Builder(