code_field
code_field copied to clipboard
Delete CodeController.onChange
CodeController.onChange can be replaced with
controller.addListener(() {
final text = controller.rawText;
});
If we delete onChange(), the benefits are:
- User code is less messy. If they use both ways to listen to changes, their code is hard to maintain.
- Less code for us to maintain.
- Following Flutter convention. Controllers are listened to, and widgets have
onChangedbecause they are disposable and so cannot be listened to. BothTextFieldandCodeFieldhave one. - More consistent API.
CodeField.onChangedis called with dots with webSpaceFix whileCodeController.onChangeis called with spaces.
@BertrandBev still you added onChange after rawText, so I wander what was the motivation for it. Are you OK with deleting it in the next breaking release?