Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the provided startYear and endYear in DateTime are used properly #637

Merged
merged 2 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [next]

- Ensure the provided `startYear` and `endYear` in `DateTime` are used properly ([#627](https://github.com/bdlukaa/fluent_ui/issues/627))
- Fix left arrow key not moving to parent item on collapsed `TreeViewItem` ([#632](https://github.com/bdlukaa/fluent_ui/issues/632))

## 4.1.0

- Fixed `TreeView` selection state behavior for items that are not expanded ([#578](https://github.com/bdlukaa/fluent_ui/issues/578))
Expand All @@ -8,7 +13,6 @@
- Ensure the TabView scroll controller has clients before using it ([#615](https://github.com/bdlukaa/fluent_ui/issues/615))
- TabView now waits a time to resize after closed ([#617](https://github.com/bdlukaa/fluent_ui/issues/617))
- `ToggleButton` border width is uniform ([#610](https://github.com/bdlukaa/fluent_ui/issues/610))
- Fix left arrow key not moving to parent item on collapsed `TreeViewItem` ([#632](https://github.com/bdlukaa/fluent_ui/issues/632))

## 4.0.3+1

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.2.0"
version: "4.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down
10 changes: 7 additions & 3 deletions lib/src/controls/form/pickers/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class DatePicker extends StatefulWidget {
/// If null, the order is based on the current locale.
///
/// See also:
///
/// * [getDateOrderFromLocale], which returns the order of the fields based
/// on the current locale
final List<DatePickerField>? fieldOrder;
Expand All @@ -158,7 +159,10 @@ class DatePicker extends StatefulWidget {
..add(ObjectFlagProperty.has('focusNode', focusNode))
..add(
FlagProperty('autofocus', value: autofocus, ifFalse: 'manual focus'))
..add(DoubleProperty('popupHeight', popupHeight));
..add(DoubleProperty('popupHeight', popupHeight,
defaultValue: kPickerPopupHeight))
..add(DiagnosticsProperty<Locale>('locale', locale))
..add(IterableProperty<DatePickerField>('fieldOrder', fieldOrder));
}
}

Expand All @@ -170,8 +174,8 @@ class _DatePickerState extends State<DatePicker> {
FixedExtentScrollController? _yearController;

int get startYear =>
((widget.startYear ?? DateTime.now().year) - 100).toInt();
int get endYear => ((widget.endYear ?? DateTime.now().year) + 25).toInt();
(widget.startYear ?? (DateTime.now().year - 100)).toInt();
int get endYear => (widget.endYear ?? (DateTime.now().year + 25)).toInt();

int get currentYear {
return List.generate(endYear - startYear, (index) {
Expand Down