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
onChanged
because they are disposable and so cannot be listened to. BothTextField
andCodeField
have one. - More consistent API.
CodeField.onChanged
is called with dots with webSpaceFix whileCodeController.onChange
is 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?