# tanjilalom/bloc_practise architecture

> Architecture diagram of the GitHub repository tanjilalom/bloc_practise, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanjilalom/bloc_practise
- Repository: https://github.com/tanjilalom/bloc_practise

## Overview

##### Main Components

a. Application Layers:
- Presentation Layer (UI)
- Business Logic Layer (BLoCs)
- Data Layer
- Platform-specific Layer (Android/iOS)

b. Feature Modules:
- Home Feature
- Cart Feature
- Time Details Note Feature

**┌─ Flutter Application ─────────────────────────┐**

- ┌─ Features ──────────────────────────┐     │

- ┌─ Home ─────┐  ┌─ Cart ────┐     │     │
- UI         │  │ UI        │     │     │
- BLoC       │  │ BLoC      │     │     │
- Models     │  │ State     │     │     │
- ┘  └───────────┘     │     │

- ┌─ Time Details Note ─┐           │     │
- UI                  │           │     │
- BLoC               │           │     │
- State              │           │     │
- ┘            │     │
- ┘   │

- ┌─ Shared ───────────────────────────┐    │
- Widgets                            │    │
- Data                               │    │
- ┘    │
- ┘

##### Detailed Component Breakdown

**┌─ Feature Module ────────────────────┐**

- ┌─ UI Layer ─┐                     │
- Screen     │                     │
- Widgets    │                     │
- ┘                     │
- ↕                          │
- ┌─ BLoC Layer ┐                    │
- Events      │                    │
- States      │                    │
- Business    │                    │
- Logic       │                    │
- ┘                    │
- ↕                          │
- ┌─ Data Layer ┐                    │
- Models      │                    │
- Data Source │                    │
- ┘                    │
- ┘

##### Notes for Implementation

- Clear separation of concerns between layers
- Platform-specific implementations (Android/iOS)
- Shared components and their relationships

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Flutter_Application
        subgraph Features
            subgraph Home
                HomeUI["Home UI"]:::ui
                HomeBLoC["Home BLoC"]:::bloc
                HomeModels["Home Models"]:::data
            end

            subgraph Cart
                CartUI["Cart UI"]:::ui
                CartBLoC["Cart BLoC"]:::bloc
                CartState["Cart State"]:::data
            end

            subgraph TimeDetailsNote
                TimeUI["Time Details UI"]:::ui
                TimeBLoC["Time Details BLoC"]:::bloc
                TimeState["Time Details State"]:::data
            end
        end

        subgraph Shared
            SharedWidgets["Shared Widgets"]:::shared
            GroceryData["Grocery Data"]:::data
        end

        subgraph Platform
            Android["Android Implementation"]:::platform
            iOS["iOS Implementation"]:::platform
        end

        MainApp["Main Application"]:::main
    end

    %% Relationships
    HomeUI --> HomeBLoC
    HomeBLoC --> HomeModels
    HomeModels --> GroceryData

    CartUI --> CartBLoC
    CartBLoC --> CartState
    CartState --> GroceryData

    TimeUI --> TimeBLoC
    TimeBLoC --> TimeState

    HomeUI --> SharedWidgets
    CartUI --> SharedWidgets
    TimeUI --> SharedWidgets

    MainApp --> Features

    %% Click Events
    click HomeUI "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/home/ui/"
    click HomeBLoC "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/home/bloc/"
    click HomeModels "https://github.com/tanjilalom/Bloc_Practise/blob/master/lib/features/home/models/home_product_data_models.dart"
    click CartUI "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/cart/ui/"
    click CartBLoC "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/cart/bloc/"
    click TimeUI "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/time_details_note/ui/"
    click TimeBLoC "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/features/time_details_note/bloc/"
    click SharedWidgets "https://github.com/tanjilalom/Bloc_Practise/tree/master/lib/widgets/"
    click GroceryData "https://github.com/tanjilalom/Bloc_Practise/blob/master/lib/data/grovery_data.dart"
    click Android "https://github.com/tanjilalom/Bloc_Practise/tree/master/android/app/src/main/"
    click iOS "https://github.com/tanjilalom/Bloc_Practise/tree/master/ios/Runner/"
    click MainApp "https://github.com/tanjilalom/Bloc_Practise/blob/master/lib/main.dart"

    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef bloc fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef shared fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef platform fill:#e74c3c,stroke:#c0392b,color:white
    classDef main fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        UI["UI Component"]:::ui
        BLOC["BLoC Component"]:::bloc
        DATA["Data Component"]:::data
        SHARED["Shared Component"]:::shared
        PLAT["Platform Component"]:::platform
        MAIN["Main Component"]:::main
    end
```
