Skip to content

Commit 09b2553

Browse files
committed
6.6.0
1 parent 43fba2b commit 09b2553

File tree

6 files changed

+64
-40
lines changed

6 files changed

+64
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.6.0 - 2025-10-27
2+
- Added `gridPadding` to `PickerDialogSettings`: defines the padding between the grid and the dialog border.
3+
- Removed unwanted scrollbar from grid [#122](https://github.com/Macacoazul01/month_picker_dialog/issues/122)
4+
15
## 6.5.0 - 2025-08-17
26
- Added `yearsPerPage` to `PickerDialogSettings`: defines how many years the dialog will have per page.
37
- Loosen intl constraint.

example/ios/Flutter/flutter_export_environment.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22
# This is a generated file; do not edit or check into version control.
3-
export "FLUTTER_ROOT=/Users/gian/flutter"
4-
export "FLUTTER_APPLICATION_PATH=/Users/gian/Desktop/month_picker_dialog/example"
3+
export "FLUTTER_ROOT=C:\flutter"
4+
export "FLUTTER_APPLICATION_PATH=C:\Users\gian_\Desktop\month_picker_dialog\example"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6-
export "FLUTTER_TARGET=lib/main.dart"
6+
export "FLUTTER_TARGET=lib\main.dart"
77
export "FLUTTER_BUILD_DIR=build"
88
export "FLUTTER_BUILD_NAME=1.0.0"
99
export "FLUTTER_BUILD_NUMBER=1"

lib/src/helpers/settings/dialog_settings.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class PickerDialogSettings {
1919
this.locale,
2020
this.insetPadding,
2121
this.yearsPerPage = 12,
22+
this.gridPadding = const EdgeInsets.all(8),
2223
}) : assert(forceSelectedDate == dismissible || !forceSelectedDate,
2324
'forceSelectedDate can only be used with dismissible = true');
2425

@@ -97,6 +98,11 @@ class PickerDialogSettings {
9798
/// default: `null`
9899
final EdgeInsets? insetPadding;
99100

101+
/// Defines the grid padding of the dialog.
102+
///
103+
/// default: `EdgeInsets.all(8)`
104+
final EdgeInsets gridPadding;
105+
100106
/// Defines how many years will be shown on each page.
101107
///
102108
/// default: `12`
@@ -118,6 +124,7 @@ class PickerDialogSettings {
118124
Color? dialogBackgroundColor,
119125
Locale? locale,
120126
EdgeInsets? insetPadding,
127+
EdgeInsets? gridPadding,
121128
int? yearsPerPage,
122129
}) {
123130
return PickerDialogSettings(
@@ -140,6 +147,7 @@ class PickerDialogSettings {
140147
dialogBackgroundColor ?? this.dialogBackgroundColor,
141148
locale: locale ?? this.locale,
142149
insetPadding: insetPadding ?? this.insetPadding,
150+
gridPadding: gridPadding ?? this.gridPadding,
143151
yearsPerPage: yearsPerPage ?? this.yearsPerPage,
144152
);
145153
}

lib/src/month_selector/month_year_grid.dart

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,32 @@ class MonthYearGridBuilder extends StatelessWidget {
1616

1717
@override
1818
Widget build(BuildContext context) {
19-
return GridView.count(
20-
physics: const ClampingScrollPhysics(),
21-
padding: const EdgeInsets.all(8.0),
22-
crossAxisCount: 4,
23-
children: List<Widget>.generate(
24-
12,
25-
(final int index) => MonthButton(
26-
theme: controller.theme,
27-
date: DateTime(
28-
controller.localFirstDate != null
29-
? controller.localFirstDate!.year + page
30-
: page,
31-
index + 1),
32-
localeString: getLocale(context,
33-
selectedLocale:
34-
controller.monthPickerDialogSettings.dialogSettings.locale),
35-
onMonthSelected: onMonthSelected,
36-
controller: controller,
37-
),
38-
).toList(growable: false),
19+
return ScrollConfiguration(
20+
behavior: ScrollConfiguration.of(context).copyWith(
21+
scrollbars: false,
22+
),
23+
child: GridView.count(
24+
physics: const NeverScrollableScrollPhysics(),
25+
padding:
26+
controller.monthPickerDialogSettings.dialogSettings.gridPadding,
27+
crossAxisCount: 4,
28+
children: List<Widget>.generate(
29+
12,
30+
(final int index) => MonthButton(
31+
theme: controller.theme,
32+
date: DateTime(
33+
controller.localFirstDate != null
34+
? controller.localFirstDate!.year + page
35+
: page,
36+
index + 1),
37+
localeString: getLocale(context,
38+
selectedLocale:
39+
controller.monthPickerDialogSettings.dialogSettings.locale),
40+
onMonthSelected: onMonthSelected,
41+
controller: controller,
42+
),
43+
).toList(growable: false),
44+
),
3945
);
4046
}
4147
}

lib/src/year_selector/year_grid.dart

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,27 @@ class YearGrid extends StatelessWidget {
1818
final String localeString = getLocale(context,
1919
selectedLocale:
2020
controller.monthPickerDialogSettings.dialogSettings.locale);
21-
return GridView.count(
22-
physics: const ClampingScrollPhysics(),
23-
padding: const EdgeInsets.all(8.0),
24-
crossAxisCount: 4,
25-
children: List<Widget>.generate(
26-
controller.monthPickerDialogSettings.dialogSettings.yearsPerPage,
27-
(final int index) => YearButton(
28-
theme: controller.theme,
29-
controller: controller,
30-
page: page,
31-
index: index,
32-
onYearSelected: onYearSelected,
33-
localeString: localeString,
34-
),
35-
).toList(growable: false),
21+
return ScrollConfiguration(
22+
behavior: ScrollConfiguration.of(context).copyWith(
23+
scrollbars: false,
24+
),
25+
child: GridView.count(
26+
physics: const NeverScrollableScrollPhysics(),
27+
padding:
28+
controller.monthPickerDialogSettings.dialogSettings.gridPadding,
29+
crossAxisCount: 4,
30+
children: List<Widget>.generate(
31+
controller.monthPickerDialogSettings.dialogSettings.yearsPerPage,
32+
(final int index) => YearButton(
33+
theme: controller.theme,
34+
controller: controller,
35+
page: page,
36+
index: index,
37+
onYearSelected: onYearSelected,
38+
localeString: localeString,
39+
),
40+
).toList(growable: false),
41+
),
3642
);
3743
}
3844
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: month_picker_dialog
22
description: Internationalized dialog for picking a single month from an infinite list of years.
3-
version: 6.5.0
3+
version: 6.6.0
44
homepage: https://github.com/Macacoazul01/month_picker_dialog
55

66
environment:
@@ -9,7 +9,7 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
provider: ^6.1.5
12+
provider: ^6.1.5+1
1313
intl:
1414

1515
dev_dependencies:

0 commit comments

Comments
 (0)