2

I have a flutter project using GetX library. I try to follow the GetX Pattern (more about GetX Pattern here).

My question is about code architecture. Is it considered a good practice to have multiple views inside one module?

Currently, I have a Authentication module that contains several views (login_view, register_view, forgot_password_view, etc...), like on the screen below:

folder structure with getx pattern

I find it more logical that way, but I didn't find any example of people doing the same.

The problem I have with one view per module is that I end up with a lot of modules, and it becomes difficult to navigate the folder tree when your app is getting more complex.

Manu
  • 372
  • 2
  • 12

2 Answers2

2

When your project is too big, it's so tough to handle. It would be good practice if you go with feature driven structure.

view
├─ auth_view
│  ├─ auth_view.dart
│  ├─ widget
│  │  ├─ email_validate_view.dart
│  │  ├─ password_validate_view.dart
├─ home_view/
├─ shop_view/
Jahidul Islam
  • 11,435
  • 3
  • 17
  • 38
  • Please add some explanation and make sure that your answer really answers the question op has asked. – BDL Aug 30 '21 at 12:04
0

Yes, we can separate by global widgets and module widgets, having page.dart as main. I recommend you a project of your own, based on various programming patterns made to meet languages ​​with a reactive paradigm. https://github.com/kauemurakami/getx_pattern