How tushar-agrawal-21/flutter_time_duration_picker works
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.