if(event is TextInputEvent) {
print("${event.text}");
}
this will also handle TextEditingEvents. This is probably not what people coming from other languages would expect and the meaning of text editing event is likely different than text input event.
In addition, apparently when ALT + TAB-ing away from a window, SDL will generate one or more (I didn't check the exact number) of text editing events with an empty text property.
I fixed the problem simply enough though by just not doing anything if it's a text editing event.
The reason for this is that if you do:
this will also handle TextEditingEvents. This is probably not what people coming from other languages would expect and the meaning of text editing event is likely different than text input event. In addition, apparently when ALT + TAB-ing away from a window, SDL will generate one or more (I didn't check the exact number) of text editing events with an empty text property. I fixed the problem simply enough though by just not doing anything if it's a text editing event.