Skip to content

Modules

Module ArchitectureModule Architecture

The root directory contains some Dart files for configuration of the module. The most important ones are:

File Description
config.dart Base module initializer
extensions.dart Dart extension methods to extend for example the generated models with converters without much boilerplate code
features.dart Defines string constants of features (if present)
navigation.dart Internal navigation definition for a view (if the module is a view)
<module_name>.dart Exporter of the modules dart files
pages.dart Contains the constants of all navigable views as NavPage elements (if the module contains pages)
provider.dart Provider for data state management with Riverpod
refresh.dart Defines the dependencies of refreshable models in case, that one model was updated (if required)

Features are additional functions that can be activated within a module.

They are structured in separate subdirectories inside the lib/features directory.

A feature can be anything that is not required for the basic functionality of a module, but would optionally enrich the module.

Examples:

Module Features
accounts account documents
cards atm search
transactions cash flow
trend balance

The models for the API calls are stored in this package. These are usually generated.

If a module contains a page view, it must contain at least the following files:

File Description
<page name>_viewmodel.dart Describes a model for the concrete view, which contains all required data.
<page name>_container.dart The container is the UI representation of the view
provider.dart Provider for the view model data

If a module has multiple pages (e.g. a pageflow), the pages should be divided into subfolders.

The repository contains an abstract class for extensions and a concrete implementation for the data management (API client).

The naming convention for repositories is:

  • business functionality as abstract class
  • implementation with the suffix _repository

Examples:

Business Functionality Abstract Class Name Implementation
banks banks.dart banks_repository.dart
accounts accounts.dart accounts_repository.dart