This document provides a concise explanation of the main elements of the Captain project, structured by file/directory.
- Purpose: Defines the
Manager
abstract class, intended for components managing specific parts of the app. - Key Features:
init()
method: Called during app startup for initialization.toString
override for providing titles.
- Purpose: Provides core infrastructure, including logging and app-wide management.
- Key Features:
AppManager
(singleton): Handles app-level initialization and logging viapprint()
.
- Purpose: Manages global application state.
- Key Features:
ApplicationState
class: ExtendsChangeNotifier
for reactive state management.updateConfig
: Allows controlled updates to the app's configuration.
- Purpose: Defines the main
HomeScreen
UI. - Key Features:
- Scaffold with an
AppBar
titled "Captain ©". - Integrates the
MainEditor
widget and aSimpleToolbar
.
- Scaffold with an
- Purpose: Implements a rich-text editor interface.
- Key Features:
MainEditor
widget:- Accepts a list of
Toolbar
objects for customization. - Displays a list of toolbar actions and an editable area.
- Accepts a list of
ToolBarItemView
widget: Represents individual toolbar actions.
- Purpose: Implements toolbars with actions for the editor.
- Key Features:
SimpleToolbar
: Includes a "Save" action.
- Purpose: Defines the structure of toolbar actions and views.
- Key Features:
ActionView
: Represents a toolbar action (title, icon, action handler).Toolbar
: Holds a collection ofActionView
objects.
- Purpose: Manages application configuration, including themes.
- Key Features:
Theme
andConfig
classes: Use Freezed for immutability and JSON serialization.Config
centralizes app-wide settings.
- Purpose: Generated serialization/deserialization logic for
Theme
andConfig
.
- Purpose: Entry point for the application.
- Key Features:
- Initializes
AppManager
and global state (ApplicationState
). - Runs the
MainApp
, which usesHomeScreen
.
- Initializes
- Placeholder for experiments.
- Currently unused.
- Core Classes:
Manager
,AppManager
,ApplicationState
. - UI Structure: Modular and reusable widgets (
MainEditor
,Toolbars
). - Data Handling: Configurable settings through Freezed-based DTOs (
Theme
,Config
). - Logging: Centralized via
AppManager.pprint
.
This structure ensures modularity, scalability, and clean separation of concerns.