pariyatti / mobile-app

The Pariyatti mobile app
https://pariyatti.app/
GNU Affero General Public License v3.0
8 stars 11 forks source link

Extract Chunks: View Layer #36

Open deobald opened 3 years ago

deobald commented 3 years ago

Flutter view code can often get nested quite deeply and it becomes hard to identify abstractions that can be extracted and reused. We'll try doing a mob coding exercise to see what might be a good approach to this problem: cleaning up the code, naming some clean ideas/abstractions through Extract Function (https://refactoring.com/catalog/extractFunction.html) and possibly the creation of custom widgets.

NamanShergill commented 3 years ago

The current codebase does not seem complex/nested enough at the moment, I think most widgets that require being made standalone have already been done so. I'll see where I can make improvements on this though.

deobald commented 3 years ago

Yeah, a "catalog of custom widgets" is probably a stretch... we should really extract a bunch of UI functions, though. There's no need for deep nesting in the Flutter UI elements; they can adhere to the same rough rule as all C/Java-style code: functions longer than 5 lines are getting too long, functions nested more than 2 levels are getting too deep. (Give or take.)