//To clear a textField, use a TextEditing Controller
final _controller = TextEditingController();
Column(
children: [
TextField(
decoration: InputDecoration(labelText: 'Title'),
controller: _controller,
onChanged: (value) {
titleInput = value;
}),
ElevatedButton(
onPressed: () => _controller.clear(),
child: Text('Add Transaction!'),
),
],
),