[color=#DEB887]A coding pattern for building mobile apps with flutter at scale.
The main goal of SoluBloc is to define a specific way to structure code so that it can be easy for someone new to understand the structure.
It is a pattern for developing flutter application using bloc, singletones and streams to manage data. It also uses jaquar_orm package for data.
SoluBloc has a pattern for structuring code into package depending on the functionality of the code.
Android Studio | VS Code |
---|---|
-
api This folder houses 2 main components of api divided into files.
api.dart
containsApi
class where all endpoint calls for apis are defined.dio_api.dart
containsDioApi
, the base class that is implemented byApi
. Here is where all the interceptors for requests and responses are implemented.
-
bloc This folder contains all business logic components for the app. The main reason for it being placed as a top level folder is because code from one bloc can be shared from different
screens
orwidgets
. All files under this folder should use the format*_bloc
i.ecounter_bloc
for a business logic component that handles the counter. TheBloc
class which is implemented by all classes in this folder has a function callednotifyChanges()
which should be called to notify the provider of any changes that take place. The general structure of code should be as desplayed below.
{%gist mordeccai/23e8aea5ade68c17b6d76fe160db504b%}