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. Both TextField and CodeField have one.
More consistent API. CodeField.onChanged is called with dots with webSpaceFix while CodeController.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?
CodeController.onChange
can be replaced withIf we delete
onChange()
, the benefits are:onChanged
because they are disposable and so cannot be listened to. BothTextField
andCodeField
have one.CodeField.onChanged
is called with dots with webSpaceFix whileCodeController.onChange
is called with spaces.@BertrandBev still you added
onChange
afterrawText
, so I wander what was the motivation for it. Are you OK with deleting it in the next breaking release?