I am pretty new in Dart and I would like to know, how to make Function defined as a property more type safe:
class NewTransaction extends StatelessWidget {
final titleController = TextEditingController();
final amountController = TextEditingController();
final Function addNewTx;
NewTransaction(this.addNewTx);
With type safety I mean, that I can determine what are the inputs and outputs. Now I can pass anything to Function object.