Skip to content

Material Date Picker code restructure#70708

Merged
darrenaustin merged 8 commits intoflutter:masterfrom
darrenaustin:date_picker_structure
Nov 20, 2020
Merged

Material Date Picker code restructure#70708
darrenaustin merged 8 commits intoflutter:masterfrom
darrenaustin:date_picker_structure

Conversation

@darrenaustin
Copy link
Contributor

Description

In order to better match the rest of the framework code base, this PR restructures the implementation of the Material Date Picker. The current code structure for the date pickers is:

material/pickers
├── calendar_date_picker.dart
├── calendar_date_range_picker.dart
├── date_picker_common.dart
├── date_picker_deprecated.dart
├── date_picker_dialog.dart
├── date_picker_header.dart
├── date_range_picker_dialog.dart
├── date_utils.dart
├── input_date_picker.dart
├── input_date_range_picker.dart
└── pickers.dart

I would like to combine several of these and move everything up to the top level material directory as follows:

File Contents
material/date_picker.dart showDatePicker/RangePicker, date_picker_header and dialogs
material/calendar_date_picker.dart just a move
material/date_picker_deprecated.dart just a move
material/date.dart date utilities from date_utils.dart & date_picker_common.dart
material/input_date_picker_form_field.dart move from input_date_picker.dart

In addition, we should add new test files for the top level components:

test/material/calendar_date_picker_test
test/material/input_date_picker_form_field_test.dart

This should bring the code structure for the Date Pickers to be more inline with the rest of the flutter framework, and thus easier for people to follow. This will also remove un-exported public symbols that were still technically available for people to use.

Related Issues

Fixes: #69939

Tests

I added the following tests:

test/material/calendar_date_picker_test
test/material/input_date_picker_form_field_test.dart

And moved others around.

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them?

  • No, no existing tests failed, so this is not a breaking change.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Nov 17, 2020
@google-cla google-cla bot added the cla: yes label Nov 17, 2020
Copy link
Contributor

@rami-a rami-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change lgtm

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darrenaustin darrenaustin merged commit c5f8edd into flutter:master Nov 20, 2020
@darrenaustin darrenaustin deleted the date_picker_structure branch November 20, 2020 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date Picker code structure refactor

3 participants