# sanghmitra278/flutter_baghbani_survey_app architecture

> Architecture diagram of the GitHub repository sanghmitra278/flutter_baghbani_survey_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanghmitra278/flutter_baghbani_survey_app
- Repository: https://github.com/sanghmitra278/flutter_baghbani_survey_app

## Overview

1. **Project type and runtime**
   - This is a **Flutter mobile app** called **Baghbani Survey**, so the core application runs in the **Dart/Flutter runtime** and is packaged through **Android** and **iOS** native shells.

2. **Entry and app startup**
   - The main entry point is `lib/main.dart`.
   - A `lib/splash.dart` screen exists, so the startup flow likely begins with a splash/landing screen before navigating into the main app experience.

3. **Platform wrappers**
   - `android/` and `ios/` contain the generated native host apps and launcher configuration.
   - `MainActivity.kt` and `AppDelegate.swift` are thin platform bridges; the app’s real UI and logic live in `lib/`.

4. **Primary presentation layer**
   - `lib/basic/` contains most of the app screens: `dashboard.dart`, `form_page.dart`, and a sequence of pages like `second_page.dart` through `thirteen_page.dart`.
   - This suggests a **multi-step survey or workflow-driven UI**, where the dashboard or form screen routes into several feature pages.

5. **Reusable widgets and UI primitives**
   - `lib/widgets/` holds shared components such as:
     - `orchard_card.dart`
     - `orchard_spinner.dart`
   - `lib/basic/custom_dropdown.dart`, `folding_cell.dart`, `table_cell.dart`, and `my_widget.dart` are additional reusable UI building blocks.
   - These are the main presentation components that multiple screens likely compose.

6. **Domain models**
   - `lib/models/` defines structured data objects:
     - `division_model.dart`
     - `district_model.dart`
     - `sub_division_model.dart`
     - `block_model.dart`
     - `village_model.dart`
   - The naming shows a **geographic hierarchy**, which is central to the app’s data selection and survey context.

7. **Data/service layer**
   - `lib/services/get/district_block_service.dart` is the only explicit service file.
   - This is the boundary where UI pages likely obtain district/block-related data, keeping retrieval logic out of widgets.
   - The presence of `get/` in the path suggests a service namespace or possibly a GetX-style organization, but the architectural point is that data access is separated from screens.

8. **Configuration and shared constants**
   - `lib/constants/app_constants.dart` centralizes app-wide values.
   - This typically supports screen titles, API endpoints, labels, or fixed options used by the forms and dropdowns.

9. **Assets**
   - `assets/images/` holds static visual resources used by the Flutter UI.
   - These likely support splash branding, dashboard visuals, or survey-related icons/cards.

10. **Expected data flow**
   - The likely flow is: **app start → splash → dashboard/form → selection widgets/dropdowns → service fetches district/block hierarchy → models hold the structured data → UI pages render survey steps**.
   - The reusable widgets sit between the pages and the models/services, acting as the composition layer.

11. **Architecture boundary summary**
   - The repo is organized as a fairly standard Flutter app with:
     - **platform shell** (`android/`, `ios/`)
     - **presentation/UI** (`lib/basic`, `lib/widgets`, `lib/splash.dart`)
     - **data models** (`lib/models`)
     - **service/data access** (`lib/services`)
     - **shared config** (`lib/constants`)
   - There is no obvious separate backend in this repository; any remote data access would be encapsulated inside the Flutter service layer.

12. **Testing and tooling**
   - `analysis_options.yaml` indicates Flutter/Dart static analysis is enabled.
   - `ios/RunnerTests` exists, but there are no visible Dart test files in the tree, so automated app logic testing appears minimal from the repository structure alone.

Main entry points: [`lib/basic/form_page.dart`](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/form_page.dart) (Form page), [`lib/basic/dashboard.dart`](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/dashboard.dart) (Dashboard), [`lib/splash.dart`](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/splash.dart) (Splash), [`lib/main.dart`](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/main.dart) (Main app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform shells"]
  node_android_shell["Android shell<br/>native host<br/>[MainActivity.kt]"]
  node_ios_shell["iOS shell<br/>native host<br/>[AppDelegate.swift]"]
end

subgraph group_ui["Flutter UI"]
  node_main["Main app<br/>Flutter entry<br/>[main.dart]"]
  node_splash["Splash<br/>startup screen<br/>[splash.dart]"]
  node_dashboard["Dashboard<br/>screen<br/>[dashboard.dart]"]
  node_form["Form page<br/>screen<br/>[form_page.dart]"]
  node_step2["Second page<br/>workflow screen<br/>[second_page.dart]"]
  node_step3["Third page<br/>workflow screen<br/>[third_page.dart]"]
  node_step4["Fourth page<br/>workflow screen<br/>[fourth_page.dart]"]
  node_step5["Fifth page<br/>workflow screen<br/>[fifth_page.dart]"]
  node_step6["Sixth page<br/>workflow screen<br/>[sixth_page.dart]"]
  node_step7["Seventh page<br/>workflow screen<br/>[seven_page.dart]"]
  node_step8["Eighth page<br/>workflow screen<br/>[eight_page.dart]"]
  node_step9["Ninth page<br/>workflow screen<br/>[ninth_page.dart]"]
  node_step10["Tenth page<br/>workflow screen<br/>[tenth_page.dart]"]
  node_step11["Eleventh page<br/>workflow screen<br/>[eleventh_page.dart]"]
  node_step12["Twelfth page<br/>workflow screen<br/>[twelve_page.dart]"]
  node_step13["Thirteenth page<br/>workflow screen<br/>[thirteen_page.dart]"]
  node_widgets["Shared widgets<br/>UI primitives"]
end

subgraph group_data["Domain & data"]
  node_constants["App constants<br/>config<br/>[app_constants.dart]"]
  node_services["District service<br/>data service"]
  node_models[("Location models<br/>domain models")]
end

subgraph group_assets["Assets"]
  node_images["Image assets<br/>static assets"]
end

node_main -->|"starts at"| node_splash
node_splash -->|"enters"| node_dashboard
node_dashboard -->|"opens"| node_form
node_form -->|"routes to"| node_step2
node_step2 -->|"continues"| node_step3
node_step3 -->|"continues"| node_step4
node_step4 -->|"continues"| node_step5
node_step5 -->|"continues"| node_step6
node_step6 -->|"continues"| node_step7
node_step7 -->|"continues"| node_step8
node_step8 -->|"continues"| node_step9
node_step9 -->|"continues"| node_step10
node_step10 -->|"continues"| node_step11
node_step11 -->|"continues"| node_step12
node_step12 -->|"continues"| node_step13
node_form -->|"composes"| node_widgets
node_dashboard -->|"composes"| node_widgets
node_form -->|"fetches"| node_services
node_services -->|"returns"| node_models
node_widgets -->|"renders"| node_models
node_form -->|"reads"| node_constants
node_dashboard -->|"uses"| node_images
node_splash -->|"uses"| node_images
node_android_shell -->|"hosts"| node_main
node_ios_shell -->|"hosts"| node_main

click node_main "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/main.dart"
click node_splash "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/splash.dart"
click node_dashboard "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/dashboard.dart"
click node_form "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/form_page.dart"
click node_step2 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/second_page.dart"
click node_step3 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/third_page.dart"
click node_step4 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/fourth_page.dart"
click node_step5 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/fifth_page.dart"
click node_step6 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/sixth_page.dart"
click node_step7 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/seven_page.dart"
click node_step8 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/eight_page.dart"
click node_step9 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/ninth_page.dart"
click node_step10 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/tenth_page.dart"
click node_step11 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/eleventh_page.dart"
click node_step12 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/twelve_page.dart"
click node_step13 "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/thirteen_page.dart"
click node_constants "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/constants/app_constants.dart"
click node_services "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/services/get/district_block_service.dart"
click node_android_shell "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/android/app/src/main/kotlin/com/example/seed_development/MainActivity.kt"
click node_ios_shell "https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/ios/Runner/AppDelegate.swift"
click node_images "https://github.com/sanghmitra278/flutter_baghbani_survey_app/tree/master/assets/images"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android_shell,node_ios_shell toneBlue
class node_main,node_splash,node_dashboard,node_form,node_step2,node_step3,node_step4,node_step5,node_step6,node_step7,node_step8,node_step9,node_step10,node_step11,node_step12,node_step13,node_widgets toneAmber
class node_constants,node_services,node_models toneMint
class node_images toneRose
```

## Components

### Platform shells

Native Android and iOS wrappers around the Flutter app.

- [Android shell](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/android/app/src/main/kotlin/com/example/seed_development/MainActivity.kt): native host · Android launcher and embedding layer for the Flutter app. · `android/app/src/main/kotlin/com/example/seed_development/MainActivity.kt`
- [iOS shell](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/ios/Runner/AppDelegate.swift): native host · iOS launcher and embedding layer for the Flutter app. · `ios/Runner/AppDelegate.swift`

### Flutter UI

Startup screen and workflow pages composing the survey experience.

- [Main app](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/main.dart): Flutter entry · Application entry point and top-level bootstrap. · `lib/main.dart`
- [Splash](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/splash.dart): startup screen · Initial landing screen before the main workflow. · `lib/splash.dart`
- [Dashboard](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/dashboard.dart): screen · Primary landing screen for the survey flow. · `lib/basic/dashboard.dart`
- [Form page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/form_page.dart): screen · Core survey form and navigation hub. · `lib/basic/form_page.dart`
- [Second page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/second_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/second_page.dart`
- [Third page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/third_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/third_page.dart`
- [Fourth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/fourth_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/fourth_page.dart`
- [Fifth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/fifth_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/fifth_page.dart`
- [Sixth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/sixth_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/sixth_page.dart`
- [Seventh page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/seven_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/seven_page.dart`
- [Eighth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/eight_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/eight_page.dart`
- [Ninth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/ninth_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/ninth_page.dart`
- [Tenth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/tenth_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/tenth_page.dart`
- [Eleventh page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/eleventh_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/eleventh_page.dart`
- [Twelfth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/twelve_page.dart): workflow screen · One step in the multi-page survey flow. · `lib/basic/twelve_page.dart`
- [Thirteenth page](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/basic/thirteen_page.dart): workflow screen · Final visible step in the survey sequence. · `lib/basic/thirteen_page.dart`
- **Shared widgets**: UI primitives · Reusable cards, spinners, dropdowns, and table cells.

### Domain & data

Models, services, and shared constants used by the UI.

- [App constants](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/constants/app_constants.dart): config · Shared app-wide values used across screens. · `lib/constants/app_constants.dart`
- [District service](https://github.com/sanghmitra278/flutter_baghbani_survey_app/blob/master/lib/services/get/district_block_service.dart): data service · Fetches district and block hierarchy data for the UI. · `lib/services/get/district_block_service.dart`
- **Location models**: domain models · Structured geographic entities used by forms and selectors.

### Assets

Static visual resources bundled with the app.

- [Image assets](https://github.com/sanghmitra278/flutter_baghbani_survey_app/tree/master/assets/images): static assets · Bundled images used by splash, dashboard, and cards. · `assets/images`

## Connections

- Main app → Splash: starts at · App bootstrap opens the splash screen first.
- Splash → Dashboard: enters · Splash transitions into the main dashboard.
- Dashboard → Form page: opens · Primary navigation continues into the survey form.
- Form page → Second page: routes to · Form workflow advances to the next step.
- Second page → Third page: continues · Survey pages progress sequentially.
- Third page → Fourth page: continues · Survey pages progress sequentially.
- Fourth page → Fifth page: continues · Survey pages progress sequentially.
- Fifth page → Sixth page: continues · Survey pages progress sequentially.
- Sixth page → Seventh page: continues · Survey pages progress sequentially.
- Seventh page → Eighth page: continues · Survey pages progress sequentially.
- Eighth page → Ninth page: continues · Survey pages progress sequentially.
- Ninth page → Tenth page: continues · Survey pages progress sequentially.
- Tenth page → Eleventh page: continues · Survey pages progress sequentially.
- Eleventh page → Twelfth page: continues · Survey pages progress sequentially.
- Twelfth page → Thirteenth page: continues · Survey pages progress sequentially.
- Form page → Shared widgets: composes · Forms and selectors reuse shared UI primitives.
- Dashboard → Shared widgets: composes · Dashboard uses shared cards and spinner components.
- Form page → District service: fetches · Survey UI requests district and block data.
- District service → Location models: returns · Service layer populates structured location models.
- Shared widgets → Location models: renders · Reusable selectors and display widgets consume model data.
- Form page → App constants: reads · Shared labels and configuration support the workflow.
- Dashboard → Image assets: uses · Static imagery supports the app's presentation layer.
- Splash → Image assets: uses · Splash branding is backed by bundled assets.
- Android shell → Main app: hosts · Android native shell launches the Flutter entry point.
- iOS shell → Main app: hosts · iOS native shell launches the Flutter entry point.
