Skip to content

Add support for TextFormField in getText command #40

Description

@tnmma96

I'm running into an issue in which command getText returns an empty string from a TextFormField widget.
I notice that ElementHelper.getText() method hasn't supported retrieving text from this widget class, can you take a look and add TextFormField retrieval logic to this method?
Thank you in advance.

if (widget is Text) {
if (widget.data != null) {
buffer.write(widget.data);
} else if (widget.textSpan != null) {
buffer.write(widget.textSpan!.toPlainText());
}
} else if (widget is RichText) {
buffer.write(widget.text.toPlainText());
} else if (widget is EditableText) {
buffer.write(widget.controller.text);
} else if (widget is TextField) {
buffer.write(widget.controller?.value.text);
} else if (widget is ButtonStyleButton) {
buffer.write(getElementTextRecursively(widget.child, visited: visited));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions