Overview
There_ucm_lib library provides high-level services and business logic for the ReUCM application. It includes portal session management, settings persistence, recent books tracking, and path template formatting.
Version: 1.0.0
Dependencies
re_ucm_core- Core models and interfacesmobx- State managementsembast- NoSQL database for persistencefreezed- Immutable data classesjson_annotation- JSON serialization
Exports
The library exports three main service categories:Settings
settings/settings_service.dart- Main settings servicesettings/domain/path_placeholders.dart- Path placeholder definitionssettings/domain/path_template.cg.dart- Path template modelssettings/domain/template_formatter.dart- Template rendering utilities
Recent books
recent_books/domain/recent_book.cg.dart- Recent book modelrecent_books/recent_books_service.cg.dart- Recent books service
Portals
portals/portal_factory.dart- Portal registration and lookupportals/portal_session.cg.dart- Portal session management
Services
SettingsService
Manages application settings and portal configurations with persistence.RecentBooksService
Tracks recently viewed books with MobX observables for reactive UI updates.PortalFactory
Centralized registry for portal implementations.PortalSession
Manages a portal instance with its settings, providing reactive state and persistence.Data models
RecentBook
Represents a recently viewed book with minimal metadata for quick display.PathTemplate
Defines how book files should be named and organized.PathPlaceholders
Enum defining available placeholders for path templates.TemplateFormatter
Utility class for rendering path templates with book data.Persistence
All services use Sembast for NoSQL persistence:- Settings are stored in a local database
- Portal configurations are persisted per portal code
- Recent books are stored with timestamps
- Changes are automatically saved to disk