The most important aspects when transitioning from React Native to Flutter
Solution 1
You can get all the important factors to grow your self for learning flutter from the React Native background via Official Documentation
Just go through it and you're all set to rock the flutter floor.
Solution 2
I would just replicate your usual structure under lib/ rather than src/
When I do the first project on a new platform, I assume that half way through, I am going to suddenly ‘understand’ how we/I should have done it.
So just get stuck in with your usual methods and then let yourself stop and do a major refactor at the half-way stage.
Solution 3
There is not best approach for flutter but i will give my own approach i like to have two files to separate the logic from the UI (core and models) in core i keep all the logic from HTTP request to dealing with different logic and in the ui i keep all my views an shared styles and widgets
- core
- models
- viewmodels
- services
- ui
- shared
- views
- widgest
- main.dart
htq287
Updated on December 15, 2022Comments
-
htq287 over 1 year
Before starting a project, I always want to figure out the best ways to organize the project - the most important concepts are: How to structure
modules/components, ...
, and which suitable patterns should be use inIn React Native, the project structure, with Redux pattern, be often formed as:
- /src - types - constants - components - collection - todolist - settings - etc ... - utils - reducers - store.ts - middleware.ts - rootReducer.ts
But when transitioning from React Native to Flutter, the concepts of project structure/pattern is so different.
It seem that all our source files should be located under
/lib
.So, currently I've been facing with project structure to organize my
modules/components/ ...
, and the bestUI pattern
should be used in.Could you please give me some ideas as detailed as possible?
-
halfer over 4 yearsQuestions that are seeking a list of ideas are too broad for Stack Overflow, and are probably primarily a matter of opinion. The best questions here are single, specific questions that have a small number of potentially right answers.
-