How v0-mvp/flutter-bloc-clean-architecture-boilerplate works
Main Components
a) Presentation Layer (Top Layer)
• Pages/Screens (Authentication, Dashboard, Splash)
• Widgets (Custom Components)
• BLoC/Cubit Components
• UI State Management
b) Domain Layer (Middle Layer)
• Use Cases
• Repository Interfaces
• Domain Entities
c) Data Layer (Bottom Layer)
• Repository Implementations
• Data Sources
• External Services/APIs
Specific Implementation Details
• Rectangles with rounded corners for UI components (blue)
• Hexagons for BLoC/Cubit components (purple)
• Rectangles for use cases (orange)
b) Layer Organization:
┌─────────────────────────────────────────────┐
• Presentation Layer │
• ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
• Pages │ │ Widgets │ │ BLoC/Cubit │ │
• ┘ └──────────┘ └──────────────┘ │
• ┘
• ▲
• Dependencies
• ▼
┌─────────────────────────────────────────────┐
• Domain Layer │
• ┌─────────┐ ┌──────────────────────┐ │
• Use Cases│ │Repository Interfaces │ │
• ┘ └──────────────────────┘ │
• ┘
• ▲
• Dependencies
• ▼
┌─────────────────────────────────────────────┐
• Data Layer │
• ┌────────────┐ ┌────────────────┐ │
• Repositories│ │Data Sources │ │
• ┘ └────────────────┘ │
• ┘
Key Relationships to Highlight
• Dependency injection flow using GetIt
• BLoC pattern data flow:
• Events → BLoC → States
• BLoC → Repository → DataSource
• Authentication flow:
• SignInScreen → SignInFormBloc → AuthenticationRepository
• Theme management:
• ThemeCubit interaction with UI
Additional Elements
Supporting components:
• Error handling flow
• Router configuration (GoRouter)
• Platform-specific implementations
• Common utilities and extensions
Implementation Notes
Callouts for:
• Dependency injection setup
• BLoC observer implementation
• Error handling strategy
• Platform-specific considerations
• Testing approach