6/29/2023 0 Comments Blocs app structure![]() Remember there is no wrong or right answer. I separate everything in folders so front-end devs can work on the widgets folder where there is all the design stuff and back-end devs can works on the blocs folder where there is all the logic. There's a package layout convention for Dart (not for Flutter projects). There is not much code for this bloc at this place as the rest of it is dispersed throughout the entire app. In the image below, we see a Login bloc with models for email and password. I don't use any of those, I made my own project structure that I will explain in a moment. The basic blog will be the same regardless of the encompassing folder. Also it depends on the package its being used, for example I use BLoC as state management and these are some project structures that the package recommends: Commands call on services and inject the results into the model. Services fetch data from the outside world and return it to the app. You may even rename this as your state management architecture like providers, blocs, etc. There is no right or wrong on how to structure your Flutter project. You may place your logic for providers, blocs, or any other state management logic into this folder.
0 Comments
Leave a Reply. |