In this article I’ll extend my Portfolio Platform package with a mobile front end using the Flutter Framework with the bloc state management that is very semantic. It will output fully cross platform applications and I’m going to also try to learn a new stack. I’ll use the rx_bloc library.
Finite State Machine
All libraries, design patterns and modern software development separates:
- State/Data Models
- Data Manipulation (Dao)
- Business Logic (Service/Controller)
- User Interface (View) or other outer layer that could be Socket, HTTP Layer, Messaging Service or whatever.
The modern libraries go even further in their approaches to make software more complex, but well defined.
- Link the User Interface (or the External Layers) to the Models, DAOs & Services with reactive APIs (Streams)
- List the Possible (States) that an app could be in – and label the possible flows between states (Events). If this is implemented fully – it will make the code – true FSM. In general in programming – it is always a good idea to think about all the “else” cases.
- Inject modules into each other with Dependency Injection Containers so they could be easily mocked, tested, reconfigured in code, during build or at execution time.
Analysis on RX_BLOC
The Prime Holding company developers has contributed a lot of open source code. They probably have big teams, complex requirements, well organized corporate structure and so on. You could read and generate a lot of code using their tools and packages.
The Portfolio Platform App
The first versions of the app will be read-only view on the Platform. It will have list of Profiles and Single Profile – Detailed Information. So, the possible states are:
- Initial (empty state)
- List view (some records loaded). Bonus here will be features like Pull to Refresh & Incremental Loading
- Some sub states are – the user is at the beginning
- The user is in the middle
- The user is at the end and
- There are more to load
- There are no more records
- Profile Details View
- No Internet Connection. This may happen at all moments so it will be a part all User Screens – small label on the top.
Possible Events are:
- Initial Loading
- Pull to Refresh
- Load More
- External to the App – Internet Connection status change
- Click on Record – to go to Details
There will be two screens with their corresponding paths.
- Profiles List
- Profile Detail
If I find time, I may dive also into advanced topics like:
- Dependency Injection
- Execution Environments
- Testing. I’ve written where it is a “Best Practice” to have testing.
- Routing Plugins
- Internationalization
- Integrating a lot of Generated code – Plugins
Progress of the work and Source code snippets of the app will be included in next posts.