Comprehensive analysis of the OSMEA Core Flutter package from the masterfabric-mobile/osmea repository (dev branch)
- Overview
- Package Information
- Architecture Analysis
- Module Breakdown
- Dependencies Analysis
- File Structure
- Key Components
- Integration Points
- Recommendations
OSMEA Core is a comprehensive Flutter package that provides essential utilities, base classes, and shared logic for building scalable Flutter applications. It serves as the foundational layer for the OSMEA project ecosystem.
| Aspect | Details |
|---|---|
| Package Name | core |
| Version | 0.0.1 |
| SDK Constraint | Dart ^3.6.1, Flutter >=1.17.0 |
| License | GNU AGPL v3.0 |
| State Management | BLoC / Cubit Pattern |
| DI Framework | Injectable + GetIt |
name: core
description: "Core utilities, base classes, and shared logic for the OSMEA Flutter project."
version: 0.0.1
environment:
sdk: ^3.6.1
flutter: ">=1.17.0"- Flutter 3.19+ - Cross-platform UI framework
- Dart 3.6+ - Type-safe programming language
- BLoC 9.1+ - State management pattern
- Hydrated BLoC 10.1+ - Persisted state management
- Injectable 2.7+ - Dependency injection
- Firebase - Analytics, Remote Config, Core services
- Slang 4.11+ - Localization and internationalization
- Go Router 15.1+ - Navigation/Routing
- BLoC Pattern - Business Logic Component for state management
- Cubit Pattern - Simplified BLoC for simpler state scenarios
- Hydrated Cubit - State persistence across app restarts
- Repository Pattern - Data abstraction layer
- Dependency Injection - Injectable-based service registration
- Factory Pattern - For creating view models and services
┌─────────────────────────────────────────┐
│ Presentation │
│ (Views, Widgets, Master Views) │
├─────────────────────────────────────────┤
│ State Management │
│ (BLoC, Cubit, Hydrated Cubit) │
├─────────────────────────────────────────┤
│ Business Logic │
│ (View Models, Helpers) │
├─────────────────────────────────────────┤
│ Data Layer │
│ (Models, Storage, Remote Config) │
├─────────────────────────────────────────┤
│ Core/Foundation │
│ (DI, Base Classes, Utilities) │
└─────────────────────────────────────────┘
Core base classes for consistent view architecture.
| File | Purpose | Size |
|---|---|---|
base_view_bloc.dart |
Abstract BLoC-based view | 10KB |
base_view_cubit.dart |
Abstract Cubit-based view | 4.3KB |
base_view_hydrated_cubit.dart |
Persisted Cubit view | 2KB |
base_view_model.dart |
Base view model class | 2.5KB |
base_view_model_cubit.dart |
Cubit-based view model | 3.5KB |
base_view_model_hydrated_cubit.dart |
Persisted view model | 1KB |
base_view_state.dart |
Base state management | 3.2KB |
master_view/- Master application view wrappermaster_view_cubit/- Cubit-based master viewmaster_view_hydrated_cubit/- Hydrated master view with persistencewidgets/- Common reusable widgets (e.g.,master_scaffold_widget.dart)
Comprehensive utility helpers for various functionalities.
| Helper | File Size | Purpose |
|---|---|---|
local_notification_helper.dart |
56KB | Local push notifications |
file_download_helper.dart |
39KB | File downloads with progress |
asset_config_helper.dart |
31KB | JSON config management |
url_launcher_helper.dart |
28KB | External URL/app launching |
web_viewer_helper.dart |
28KB | HTML/WebView rendering |
datetime_helper.dart |
27KB | Date/time operations |
price_info_currency_helper.dart |
27KB | Currency formatting |
remote_config_helper.dart |
17KB | Firebase Remote Config |
double_extension_helper.dart |
12KB | Number formatting |
auth_storage_helper.dart |
11KB | Auth data persistence |
device_info_helper.dart |
4.8KB | Device information |
application_share_helper.dart |
3.3KB | Content sharing |
onboarding_helper.dart |
3.3KB | Onboarding storage |
spacer_helper.dart |
1.1KB | UI spacing utilities |
first_letter_capitalize_helper.dart |
0.5KB | String capitalization |
grid_helper.dart |
0.4KB | Grid layout helpers |
local_storage/- SharedPreferences wrapperpermission_handler_helper/- Runtime permissionspermission_handler_helper.dartmodels/permission_models.dartabstract/permission_handler_base.dart
common_logger_helper/- Logging utilities
Pre-built views with BLoC/Cubit state management.
| View | Description |
|---|---|
splash/ |
Splash screen with loading logic |
onboarding/ |
User onboarding flow |
auth/ |
Authentication (Sign In + Sign Up with TabBar) |
account/ |
User account management |
permissions/ |
Permission request screens |
error_handling/ |
Error display and recovery |
loading/ |
Loading state views |
empty_view/ |
Empty state views |
info_bottom_sheet/ |
Information bottom sheets |
image_detail/ |
Image detail viewer |
search/ |
Search functionality |
Each view includes:
*_view.dart- UI implementationcubit/*_cubit.dart- State managementcubit/*_state.dart- State definitionswidgets/- View-specific widgets (optional)
Data models for views and business logic.
| Model File | Size | Purpose |
|---|---|---|
loading_models.dart |
15.6KB | Loading state configurations |
error_handling_models.dart |
10.7KB | Error handling data |
onboarding_models.dart |
8.9KB | Onboarding page models |
splash_models.dart |
8.5KB | Splash screen configs |
empty_view_models.dart |
7.8KB | Empty state configs |
info_models.dart |
6.5KB | Info sheet configurations |
Layout utilities for consistent UI spacing.
| File | Size | Purpose |
|---|---|---|
grid.dart |
3.2KB | Grid layout system |
spacer.dart |
1.8KB | Spacing utilities |
Dependency injection configuration.
config/- Injectable configuration files
Generated localization resources.
resources.g.dart- Generated translation file (Slang)
| Package | Version | Category |
|---|---|---|
flutter_bloc |
^9.1.0 | State Management |
hydrated_bloc |
^10.1.1 | Persisted State |
equatable |
^2.0.7 | Value Equality |
go_router |
^15.1.1 | Navigation |
injectable |
^2.7.1 | Dependency Injection |
logger |
^2.5.0 | Logging |
slang |
^4.11.1 | Localization |
slang_flutter |
^4.11.0 | Flutter Localization |
url_launcher |
^6.3.1 | URL Launching |
intl |
^0.20.0 | Internationalization |
sqflite |
^2.4.2 | SQLite Database |
shared_preferences |
^2.5.3 | Key-Value Storage |
firebase_analytics |
^11.4.5 | Analytics |
firebase_core |
^3.13.0 | Firebase Core |
firebase_remote_config |
^5.3.4 | Remote Config |
device_info_plus |
^11.4.0 | Device Info |
package_info_plus |
^8.3.0 | Package Info |
dio |
^5.7.0 | HTTP Client |
path_provider |
^2.1.5 | File Paths |
permission_handler |
^11.2.0 | Permissions |
share_plus |
^10.1.4 | Content Sharing |
flutter_html |
^3.0.0 | HTML Rendering |
flutter_inappwebview |
^6.1.5 | WebView |
webview_flutter |
^4.10.0 | Native WebView |
timezone |
^0.10.1 | Timezone Handling |
flutter_local_notifications |
^19.4.2 | Local Notifications |
osmea_components |
path: ../components | UI Kit |
| Package | Version | Purpose |
|---|---|---|
flutter_test |
SDK | Testing |
build_runner |
^2.4.7 | Code Generation |
injectable_generator |
^2.11.1 | DI Code Gen |
slang_build_runner |
^4.8.0 | Localization Gen |
dependency_overrides:
build: ^4.0.0
intl: ^0.20.0packages/core/
├── 📄 .gitignore
├── 📄 .metadata
├── 📁 .vscode/
├── 📄 CHANGELOG.md
├── 📄 CODE_OF_CONDUCT.md
├── 📄 LICENSE (GNU AGPL v3.0)
├── 📄 README.md (26KB - comprehensive documentation)
├── 📄 analysis_options.yaml
├── 📁 assets/
│ ├── app_config.json
│ └── i18n/
│ └── en.json
├── 📄 devtools_options.yaml
├── 📄 firebase.json
├── 📄 pubspec.yaml
├── 📄 slang.yaml
└── 📁 lib/
├── 📄 core.dart (Main export file - 8KB)
├── 📄 firebase_options.dart (2.7KB)
├── 📁 gen/ (Generated files)
└── 📁 src/
├── 📄 core.dart (0.5KB)
├── 📁 base/
│ ├── 📄 base_view_bloc.dart
│ ├── 📄 base_view_cubit.dart
│ ├── 📄 base_view_hydrated_cubit.dart
│ ├── 📄 base_view_model.dart
│ ├── 📄 base_view_model_cubit.dart
│ ├── 📄 base_view_model_hydrated_cubit.dart
│ ├── 📄 base_view_state.dart
│ ├── 📁 master_view/
│ │ ├── 📄 master_app.dart
│ │ └── 📄 master_view.dart
│ ├── 📁 master_view_cubit/
│ │ └── 📄 master_view_cubit.dart
│ ├── 📁 master_view_hydrated_cubit/
│ │ ├── 📄 master_view_hydrated_cubit.dart
│ │ └── 📁 hydrated/
│ │ └── 📄 hydrated_bloc_init.dart
│ └── 📁 widgets/
│ └── 📄 master_scaffold_widget.dart
├── 📁 di/
│ └── 📁 config/
├── 📁 helper/
│ ├── 📄 application_share_helper.dart
│ ├── 📄 asset_config_helper.dart
│ ├── 📄 auth_storage_helper.dart
│ ├── 📄 datetime_helper.dart
│ ├── 📄 device_info_helper.dart
│ ├── 📄 double_extension_helper.dart
│ ├── 📄 file_download_helper.dart
│ ├── 📄 first_letter_capitalize_helper.dart
│ ├── 📄 grid_helper.dart
│ ├── 📄 local_notification_helper.dart
│ ├── 📄 onboarding_helper.dart
│ ├── 📄 package_info_helper.dart
│ ├── 📄 price_info_currency_helper.dart
│ ├── 📄 remote_config_helper.dart
│ ├── 📄 spacer_helper.dart
│ ├── 📄 url_launcher_helper.dart
│ ├── 📄 web_viewer_helper.dart
│ ├── 📁 common_logger_helper/
│ ├── 📁 local_storage/
│ │ └── 📄 local_storage_helper.dart
│ └── 📁 permission_handler_helper/
│ ├── 📄 permission_handler_helper.dart
│ ├── 📁 abstract/
│ │ └── 📄 permission_handler_base.dart
│ └── 📁 models/
│ └── 📄 permission_models.dart
├── 📁 layout/
│ ├── 📄 grid.dart
│ └── 📄 spacer.dart
├── 📁 models/
│ ├── 📄 empty_view_models.dart
│ ├── 📄 error_handling_models.dart
│ ├── 📄 info_models.dart
│ ├── 📄 loading_models.dart
│ ├── 📄 onboarding_models.dart
│ └── 📄 splash_models.dart
├── 📁 resources/
│ └── 📄 resources.g.dart
└── 📁 views/
├── 📄 routes.dart
├── 📁 account/
│ ├── 📄 account_view.dart
│ ├── 📁 cubit/
│ │ ├── 📄 account_cubit.dart
│ │ └── 📄 account_state.dart
│ └── 📁 widgets/
│ ├── 📄 account_widget.dart
│ └── 📄 orders_list_widget.dart
├── 📁 auth/
│ ├── 📄 auth_view.dart
│ └── 📁 cubit/
│ ├── 📄 auth_cubit.dart
│ └── 📄 auth_state.dart
├── 📁 empty_view/
├── 📁 error_handling/
├── 📁 image_detail/
├── 📁 info_bottom_sheet/
├── 📁 loading/
├── 📁 onboarding/
├── 📁 permissions/
├── 📁 search/
└── 📁 splash/
The entry point for OSMEA applications:
// MasterApp - Main application wrapper
export 'package:core/src/base/master_view/master_app.dart';
// MasterView - Unified view management
export 'package:core/src/base/master_view/master_view.dart';
// MasterViewCubit - Cubit-based master view
export 'package:core/src/base/master_view_cubit/master_view_cubit.dart';Three approaches for building views:
| Class | Use Case |
|---|---|
BaseViewBloc |
Complex state with events and states |
BaseViewCubit |
Simpler state management |
BaseViewHydratedCubit |
State persistence across restarts |
// Base State with common patterns
export 'package:core/src/base/base_view_state.dart';
// View Models for business logic
export 'package:core/src/base/base_view_model.dart';
export 'package:core/src/base/base_view_model_cubit.dart';Ready-to-use screens with customization:
- SplashView - App launch screen
- OnboardingView - User introduction
- AuthView - Sign In/Sign Up with TabBar
- AccountView - User profile management
- PermissionsView - Permission requests
- ErrorHandlingView - Error display
- LoadingView - Loading states
- EmptyView - Empty states
- InfoBottomSheetView - Information sheets
- ImageDetailView - Image viewer
- SearchView - Search interface
Comprehensive utilities organized by functionality:
// Storage
export 'package:core/src/helper/local_storage/local_storage_helper.dart';
export 'package:core/src/helper/auth_storage_helper.dart';
// UI Helpers
export 'package:core/src/helper/spacer_helper.dart';
export 'package:core/src/helper/url_launcher_helper.dart';
export 'package:core/src/helper/web_viewer_helper.dart';
// Data Helpers
export 'package:core/src/helper/datetime_helper.dart';
export 'package:core/src/helper/double_extension_helper.dart';
export 'package:core/src/helper/price_info_currency_helper.dart';
export 'package:core/src/helper/first_letter_capitalize_helper.dart';
// System Helpers
export 'package:core/src/helper/device_info_helper.dart';
export 'package:core/src/helper/permission_handler_helper/permission_handler_helper.dart';
export 'package:core/src/helper/local_notification_helper.dart';
export 'package:core/src/helper/file_download_helper.dart';
export 'package:core/src/helper/application_share_helper.dart';
// Configuration
export 'package:core/src/helper/asset_config_helper.dart';
export 'package:core/src/helper/remote_config_helper.dart';The package integrates with osmea_components:
dependencies:
osmea_components:
path: ../componentsThis is exported for use:
export 'package:osmea_components/osmea_components.dart';- Firebase Core - Foundation for all Firebase services
- Firebase Analytics - User behavior tracking
- Firebase Remote Config - Dynamic configuration
// Firebase options configuration
export 'package:core/firebase_options.dart';Configuration in slang.yaml:
- Translation files in
assets/i18n/ - Generated resources in
resources.g.dart
Using Injectable with GetIt:
- Configuration in
lib/src/di/config/ - Auto-registration of services
- Environment-based configuration
- Well-structured architecture - Clear separation of concerns
- Comprehensive helpers - Rich utility functions
- State management options - BLoC, Cubit, and Hydrated variants
- Pre-built views - Common screens ready to use
- Type-safe localization - Slang integration
- Modern dependencies - Up-to-date package versions
- Testing coverage - Add unit tests for helpers and cubits
- Documentation - Add inline documentation to exported APIs
- Example app - Include sample implementation
- Error handling - Standardize error types across helpers
- Logging - Implement consistent logging strategy
When integrating into masterfabric_core:
- Dependency Alignment - Ensure version compatibility
- Package Reference - Update
osmea_componentspath or remove - Firebase Setup - Configure firebase_options for your project
- Asset Configuration - Copy assets folder structure
- Code Generation - Run
build_runnerafter setup
# Install dependencies
flutter pub get
# Generate code (DI, localization)
dart run build_runner build --delete-conflicting-outputs
# Run tests
flutter test
# Analyze code
flutter analyze| Metric | Count |
|---|---|
| Total Dart Files | 60+ |
| Helper Classes | 21 |
| Pre-built Views | 12 |
| Model Classes | 6 |
| Base Classes | 7 |
| Production Dependencies | 25+ |
| Dev Dependencies | 4 |
Document Generated: December 22, 2025
Source: https://github.com/masterfabric-mobile/osmea/tree/dev/packages/core
Branch: dev
Commit SHA: 5a1a9dd0327b874b322b3fbe0c74739763ecd4d6
This analysis document is part of the masterfabric_core project documentation.