# tushar-agrawal-21/flutter_time_duration_picker architecture

> Architecture diagram of the GitHub repository tushar-agrawal-21/flutter_time_duration_picker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tushar-agrawal-21/flutter_time_duration_picker
- Repository: https://github.com/tushar-agrawal-21/flutter_time_duration_picker

## Overview

##### Project type and purpose
- This is a Flutter-based UI widget library (package) named **flutter_time_duration_picker**.
- Purpose: Provide a customizable time-duration picker widget for Flutter apps, exposing builder APIs, controllers, styling, and custom column support.
- It ships with an **example** Flutter app (multi-platform runners) and a **test** suite.

##### File structure
Top-level:
- pubspec.yaml, CHANGELOG.md, LICENSE, README.md, .gitignore, analysis_options.yaml
- **lib/** – public entrypoint (flutter_time_duration_picker.dart) and internal modules under src/
- **example/** – a complete Flutter application (platform folders for Android, iOS, macOS, Linux, Windows, Web) demonstrating usage
- **test/** – unit/widget tests for the picker
- **assets/** – static assets (demo screenshots, video)

Inside **lib/src/**:
- time_column_config.dart – configuration model for each column
- time_column_controller.dart – controller handling scroll/selection state
- time_duration_picker.dart – core widget composing columns into a picker
- time_picker_column.dart – abstract column definitions (hours, minutes, custom)
- time_picker_theme.dart – theming/styling definitions

##### README for insights
- No external services or backend.
- Architecture relies on Flutter’s widget-tree and controller pattern.

a. Core Library Modules (lib/src)
– Configuration Model
– Column Controller
– Picker Widget
– Column Types
– Theme & Styling
b. Public API Layer
– flutter_time_duration_picker.dart (exports builder methods)
c. Example App
– MaterialApp → Scaffold → TimeDurationPicker usage
– Platform Embedders (Android, iOS, macOS, Windows, Linux, Web)
d. Test Suite
– Unit/widget tests targeting lib/src

##### Relationships and interactions
- The **Example App** depends on the **Public API Layer**, which re-exports the **Core Library Modules**.
- Within the Core Library:
– Picker Widget composes one or more Column Widgets.
– Each Column Widget uses a Column Controller to manage scroll position and user input.
– Theme module configures visual properties consumed by both the Picker Widget and Column Widgets.
- The **Test Suite** depends on Core Library Modules to validate behavior.
- Platform Embedders launch the Flutter Engine, which runs the Dart code (Example App + Library).

##### Architectural patterns and design principles
– Widget + Controller separation (MVC-inspired)
– Modularization: Each feature (config, controller, theme, widget) is its own module.
– Public API facade exporting only the builder functions and types in flutter_time_duration_picker.dart.
– Standard Flutter plugin/example structure for cross-platform demonstration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Embedders
    subgraph "Platform Embedders"
        Android["Android Runner"]:::platform
        iOS["iOS Runner"]:::platform
        macOS["macOS Runner"]:::platform
        Linux["Linux Runner"]:::platform
        Windows["Windows Runner"]:::platform
        Web["Web Runner"]:::platform
    end

    FlutterEngine["Flutter Engine"]:::platform

    %% Example App
    subgraph "Example App"
        ExampleApp["Example App\n(MaterialApp>Scaffold>TimeDurationPicker)"]:::example
    end

    %% Public API Layer
    subgraph "Public API Layer"
        PublicAPI["Public API: flutter_time_duration_picker.dart"]:::api
    end

    %% Core Library Modules
    subgraph "Core Library Modules"
        TimeDurationPicker["TimeDurationPicker Widget"]:::core
        TimePickerColumn["TimePickerColumn (Abstract/Impl)"]:::core
        TimeColumnController(("TimeColumnController")):::core
        TimeColumnConfig[(TimeColumnConfig)]:::core
        TimePickerTheme["TimePickerTheme"]:::core
    end

    %% Test Suite
    subgraph "Test Suite"
        TestSuite["Unit/Widget Tests"]:::tests
        WidgetTest["Example App Widget Test"]:::tests
    end

    %% Assets
    subgraph "Assets"
        AssetNode["Asset Samples\nscreen_recording.mp4"]:::tests
    end

    %% Relationships
    Android --> FlutterEngine
    iOS --> FlutterEngine
    macOS --> FlutterEngine
    Linux --> FlutterEngine
    Windows --> FlutterEngine
    Web --> FlutterEngine

    FlutterEngine --> ExampleApp
    ExampleApp --> PublicAPI
    PublicAPI --> TimeDurationPicker

    TimeDurationPicker --> TimePickerColumn
    TimePickerColumn --> TimeColumnController
    TimeColumnController --> TimeColumnConfig

    TimePickerTheme --> TimeDurationPicker
    TimePickerTheme --> TimePickerColumn

    TestSuite --> TimeDurationPicker
    WidgetTest --> ExampleApp

    %% Click Events
    click TimeColumnConfig "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/src/time_column_config.dart"
    click TimeColumnController "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/src/time_column_controller.dart"
    click TimeDurationPicker "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/src/time_duration_picker.dart"
    click TimePickerColumn "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/src/time_picker_column.dart"
    click TimePickerTheme "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/src/time_picker_theme.dart"
    click PublicAPI "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/lib/flutter_time_duration_picker.dart"
    click ExampleApp "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/lib/main.dart"
    click Android "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/android/app/src/main/kotlin/com/example/flutter_time_duration_picker_example/MainActivity.kt"
    click iOS "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/ios/Runner/AppDelegate.swift"
    click macOS "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/macos/Runner/AppDelegate.swift"
    click Linux "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/linux/runner/main.cc"
    click Windows "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/windows/runner/main.cpp"
    click Web "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/web/index.html"
    click AssetNode "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/assets/screen_recording.mp4"
    click TestSuite "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/test/flutter_time_duration_picker_test.dart"
    click WidgetTest "https://github.com/tushar-agrawal-21/flutter_time_duration_picker/blob/main/example/test/widget_test.dart"

    %% Styles
    classDef core fill:#E0F2FF,stroke:#0366d6,stroke-width:1px
    classDef api fill:#E6FFEA,stroke:#28A745,stroke-width:1px
    classDef example fill:#FFF4E5,stroke:#D9822B,stroke-width:1px
    classDef tests fill:#F0F0F0,stroke:#6A737D,stroke-width:1px
    classDef platform fill:#F5E6FF,stroke:#6F42C1,stroke-width:1px
```
