Closed ybakos closed 1 year ago
In ModifyEstimateScreen, the author has created functions for each "row", which returns a Row widget. Notice how these function implementations are nearly all the same.
Create a new standalone Widget subclass, eg EstimateItemRow, that is parameterized to accommodate "what is different" in the existing functions.
Suggested steps:
return Row
in trunkLineRow
with return EstimateItemRow(a, b, c)
. This should be a single, short statement.latLineRow
. Adjust the EstimateItemRow as necessary.
Now that the screen is fairly feature-complete, it can be improved. This class exhibits duplication and also reveals an opportunity to introduce new abstractions / data structures to eliminate the duplicate code. It is a larger refactoring, so deprioritize until later (may warrant some discussion).