This makes it hard to analyze the characteristics of leaf widgets. I’d like the surveyor to take care of this case.
However, if this is a non-trivial change, as a minimal effort, we could consider adding -> unknown to the 2-gram output file, whenever an empty child or children appears.
For instance, if the analyzer says that the Row widget is a leaf, but if it contains children keyword in the code, add Row -> unknown to the 2-gram output. In that way we can at least know that the Row is not a leaf widget.
The example below is from a Flutter Create submission, named ‘realx’.
In this example, the
Row
widget takes two children, where each child widget is a functionsoundBtn()
that returns aGestureDetector
widget.But in the Flutter Outline as well as in the surveyor's 2-gram output file, this
Row
widget doesn’t seem to carry any children widget.Flutter Outline (partially captured):
Surveyor output:
This makes it hard to analyze the characteristics of leaf widgets. I’d like the surveyor to take care of this case.
However, if this is a non-trivial change, as a minimal effort, we could consider adding
-> unknown
to the 2-gram output file, whenever an empty child or children appears.For instance, if the analyzer says that the
Row
widget is a leaf, but if it containschildren
keyword in the code, addRow -> unknown
to the 2-gram output. In that way we can at least know that theRow
is not a leaf widget.