
Core Module Project
In Bspace2 we are using Modular method, the software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.
Clean Architecture BSpace2
Module is a logical entity with everything (programming code and its dependencies) to execute a desired functionality. The communication through modules is made by a common and clear contract (interface classes). The Modular Architecture can be applied in Flutter applications by using the flutter_modular package.

Configs
Config contains configurations that will be used continuously globally, for example Navigation and Translation.
- : A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more.
- : Easy and Fast internationalizing and localization your Flutter Apps, this package simplify the internationalizing process.
Constants
Serves as a centralized location to store constant values that are used across the application. These constants can include things like API endpoints, colors, font sizes, padding values, strings, and other configuration parameters.
- : This file contains functions or classes that handle tasks such as making HTTP requests to the API, parsing the responses, and returning data to other parts of the application.
- : These resources can include images, fonts, videos, or any other files that your application needs to use.
- : The main purpose of using enums in Flutter architecture is to improve code readability, maintainability, and type safety. Enums are especially useful when you have a predefined set of options or states that a variable can take.
Features
Each feature module encapsulates all the code related to a specific feature or functionality of your application. These modules typically contain UI components, business logic, data handling, and any other resources specific to that feature.
- : The presentation layer in Flutter typically involves building the user interface (UI) components and managing how they are displayed to the user. This layer encompasses widgets, screens, pages, and other visual elements that users interact with. Some common components is:
- : Pages are usually composed of one or more widgets and represent individual views or screen within your app. Each screen typically corresponds to a specific user interface state or functionality
- : These are the building blocks of the UI in Flutter. Widgets represent elements such as buttons, text fields, images, lists, etc. Widgets can be simple, like a Text widget displaying text, or complex, like a custom widget that encapsulates a specific UI component with its own behavior and appearance.
- : The controller is a way to separate business logic and apply design patterns to the coding. In the BSpace2 project we use Riverpod as state management and usually in the controller there are several state implementations.
- : The domain layer represents the heart of your application, where you define the entities, use cases, and business logic that drive the behavior of your app. The domain layer typically consists of:
- : These are classes or functions that encapsulate specific application behaviors or features. Each use case represents a single piece of functionality that your application provides to users. Use cases orchestrate interactions between entities and data sources to achieve a specific goal.
- : Params are used for Use Cases when there is a model request, in the form of a model, making the code cleaner and easier to maintain.
- : Entities are similar to Models in the Data Layer, but these entities are usually created exactly the same as the UI in the Design created by UI/UX, you could say the basic framework of the Model, and means we don't need to know what response occurs in the API.
- : Repositories define contracts or interfaces for accessing and manipulating data. They provide an abstraction layer between the domain layer and the data sources (such as databases, web services, or local storage). Repositories decouple the domain logic from the details of how data is fetched or stored.
- : This layer handles data persistence, network communication, device hardware access, and other system-level concerns.
- : Data sources are responsible for fetching and storing data from external systems. This includes databases, web APIs, local storage, and other sources of data. Data sources abstract away the details of how data is accessed and provide a consistent interface for the rest of the application.
- : Retrieve and store data from external systems and the internet using the http request Dio package.
- : A local data source typically refers to a mechanism for storing and retrieving data locally on the user's device, This data is stored locally, meaning it's available even when the device is offline, and it's often used for caching data, we will using Hive package for local data source.
- : Repositories at the Data Layer are an implementation of the framework that has been created from the Domain Layer, usually implementing data retrieval and many other services.
- : In very simpler terms, models are just classes which help us to determine the structure of the data, for eg - API responses. We all know the concept of classes in Object Oriented Programming, in this model need to create some return function (toEntities) to mapping the value API, in this model we are required to create an Entities return function (e.g. toEntities) to map data from the API into an Entity.
- : Data sources are responsible for fetching and storing data from external systems. This includes databases, web APIs, local storage, and other sources of data. Data sources abstract away the details of how data is accessed and provide a consistent interface for the rest of the application.
- : Platform services provide access to device-specific functionality and platform-specific APIs. This includes features such as accessing device sensors (e.g., GPS, accelerometer), interacting with platform services (e.g., notifications, permissions), and integrating with native code through platform channels.
Shared Module
In the module here there are many template or package customizations that have been created by Buma developers and designers.
- : This module provides you with the needs related to templates, classes and instances that you just need to use, this library containing core functionalities.
- : This module gives you a library or package of reusable UI Components, using a standard Design System.
Utils
File or directory typically contains utility functions or classes that provide common functionalities or helper methods used throughout your application. These utilities may perform tasks such as data manipulation, validation, formatting, or other miscellaneous operations.
- : Helpers are often used to encapsulate reusable logic that doesn't fit into a specific feature or module but is still valuable across different parts of your codebase.
Feature Architecture BSpace2
Typically refers to the organization and structuring of code related to specific features or functionalities within an application. It involves designing the architecture of each feature in a modular and scalable way, often following established architectural patterns or principles.

Example Project Structure
Here the example project structure used by .
.
└── feature/
├── presentation/
│ ├── pages
│ ├── widgets
│ └── controllers
├── domain/
│ ├── entities
│ ├── usecases
│ ├── params
│ └── repositories
└── data/
├── repositories
├── datasources/
│ ├── remote
│ └── local
└── models