Skip to content

Commit

Permalink
6.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Macacoazul01 committed Dec 16, 2024
1 parent 5f56dae commit 61ae10d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.0.2 - 2024-12-16
- Fixed [#109](https://github.com/Macacoazul01/month_picker_dialog/issues/109).
- Improved function docs.

## 6.0.1 - 2024-12-16
- Improved sample

Expand Down
15 changes: 10 additions & 5 deletions lib/src/helpers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,27 @@ class MonthpickerController {

///function to return the range of selected months
List<DateTime> selectRange() {
if (initialRangeDate != null && endRangeDate != null) {
if (initialRangeDate != null) {
if (endRangeDate == null) {
return [initialRangeDate!];
}

if (initialRangeDate == endRangeDate) {
return [initialRangeDate!];
}

final DateTime startDate = initialRangeDate!;
final DateTime endDate = endRangeDate!;

if (rangeList) {
return rangeListCreation(startDate, endDate);
} else {
return [startDate, endDate];
}
return [startDate, endDate];
} else {
return [];
if (endRangeDate != null) {
return [endRangeDate!];
}
}
return [];
}

///function to return the full list range of selected months
Expand Down
18 changes: 9 additions & 9 deletions lib/src/pickers/show_month_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import '/month_picker_dialog.dart';

/// Displays month picker dialog.
///
/// `initialDate:` is the initially selected month.
/// `initialDate:` the initially selected month.
///
/// `firstDate:` is the optional lower bound for month selection.
/// `firstDate:` the optional lower bound for month selection.
///
/// `lastDate:` is the optional upper bound for month selection.
/// `lastDate:` the optional upper bound for month selection.
///
/// `selectableMonthPredicate:` lets you control enabled months just like the official selectableDayPredicate.
/// `selectableMonthPredicate:` control enabled months just like the official selectableDayPredicate.
///
/// `selectableYearPredicate:` lets you control enabled years just like the official selectableDayPredicate.
/// `selectableYearPredicate:` control enabled years just like the official selectableDayPredicate.
///
/// `monthStylePredicate:` allows you to individually customize each month.
/// `monthStylePredicate:` individually customize each month.
///
/// `yearStylePredicate:` allows you to individually customize each year.
/// `yearStylePredicate:` individually customize each year.
///
/// `headerTitle:` lets you add a custom title to the header of the dialog (default is `null`).
/// `headerTitle:` add a custom title to the header of the dialog (default is `null`).
///
/// `monthPickerDialogSettings:` is the object that will hold all of the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
/// `monthPickerDialogSettings:` holds all the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
///
/// `onlyYear:` Displays only year picker dialog. Prefer to use `showYearPicker` instead of `showMonthPicker` with this parameter set to `true` to avoid unnecessary parameters.
///
Expand Down
22 changes: 11 additions & 11 deletions lib/src/pickers/show_month_range_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ import '/month_picker_dialog.dart';

/// Displays month picker dialog.
///
/// `initialRangeDate:` the initial date of the range of months to be selected.
/// `initialRangeDate:` initial selected date of the months range.
///
/// `endRangeDate:` the last date of the range of months to be selected.
/// `endRangeDate:` latest selected date of the months range.
///
/// `firstDate:` is the optional lower bound for month selection.
/// `firstDate:` optional lower bound for month selection.
///
/// `lastDate:` is the optional upper bound for month selection.
/// `lastDate:` optional upper bound for month selection.
///
/// `selectableMonthPredicate:` lets you control enabled months just like the official selectableDayPredicate.
/// `selectableMonthPredicate:` control enabled months just like the official selectableDayPredicate.
///
/// `selectableYearPredicate:` lets you control enabled months just like the official selectableDayPredicate.
/// `selectableYearPredicate:` control enabled months just like the official selectableDayPredicate.
///
/// `monthStylePredicate:` allows you to individually customize each month.
/// `monthStylePredicate:` individually customize each month.
///
/// `yearStylePredicate:` allows you to individually customize each year.
/// `yearStylePredicate:` individually customize each year.
///
/// `headerTitle:` lets you add a custom title to the header of the dialog (default is `null`).
/// `headerTitle:` adds a custom title to the header of the dialog (default is `null`).
///
/// `monthPickerDialogSettings:` is the object that will hold all of the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
/// `monthPickerDialogSettings:` holds all the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
///
/// `rangeList:` lets you define if the controller will return the full list of months between the two selected or only them (default is `false`).
/// `rangeList:` defines if the controller will return the full list of months between the two selected or only them (default is `false`).
///
Future<List<DateTime>?> showMonthRangePicker({
required BuildContext context,
Expand Down
14 changes: 7 additions & 7 deletions lib/src/pickers/show_year_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import '/month_picker_dialog.dart';

/// Displays only year picker dialog.
///
/// `initialDate:` is the initially selected month.
/// `initialDate:` initially selected month.
///
/// `firstDate:` is the optional lower bound for month selection.
/// `firstDate:` optional lower bound for month selection.
///
/// `lastDate:` is the optional upper bound for month selection.
/// `lastDate:` optional upper bound for month selection.
///
/// `selectableYearPredicate:` lets you control enabled years just like the official selectableDayPredicate.
/// `selectableYearPredicate:` control enabled years just like the official selectableDayPredicate.
///
/// `yearStylePredicate:` allows you to individually customize each year.
/// `yearStylePredicate:` individually customize each year.
///
/// `headerTitle:` lets you add a custom title to the header of the dialog (default is `null`).
/// `headerTitle:` adds a custom title to the header of the dialog (default is `null`).
///
/// `monthPickerDialogSettings:` is the object that will hold all of the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
/// `monthPickerDialogSettings:` holds all the style of the picker dialog (default is `defaultMonthPickerDialogSettings`).
///
Future<int?> showYearPicker({
required BuildContext context,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: month_picker_dialog
description: Internationalized dialog for picking a single month from an infinite list of years.
version: 6.0.1
version: 6.0.2
homepage: https://github.com/hmkrivoj/month_picker_dialog

environment:
Expand Down

0 comments on commit 61ae10d

Please sign in to comment.