Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Macacoazul01 committed Dec 9, 2023
1 parent 36591d3 commit a3abbda
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.4.0 - 2023-12-08
- Added `arrowSize` property to allow you control the size of the header arrows.

## 2.3.0 - 2023-12-08
- Removed deprecated `textScaleFactor` inside the package (the name of the parameter stays the same)
- Bumped dart to `3.0.0`,provider to `6.1.1`, intl to `0.18.1` and flutter_lints to `3.0.1`
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ There are other parameters to configure on the dialog if you want:

`textScaleFactor` lets you control the scale of the texts in the widget.

`arrowSize` lets you control the size of the header arrows.

## Screenshots
### Left-To-Right
![LTR portrait](screenshots/ltr_portrait.png)
Expand Down
4 changes: 4 additions & 0 deletions lib/month_picker_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import 'src/year_selector/year_selector.dart';
///
/// [textScaleFactor] lets you control the scale of the texts in the widget.
///
/// [arrowSize] lets you control the size of the header arrows.
///
Future<DateTime?> showMonthPicker({
required BuildContext context,
DateTime? initialDate,
Expand Down Expand Up @@ -88,6 +90,7 @@ Future<DateTime?> showMonthPicker({
int animationMilliseconds = 450,
bool hideHeaderRow = false,
double? textScaleFactor,
double? arrowSize,
}) async {
assert(forceSelectedDate == dismissible || !forceSelectedDate,
'forceSelectedDate can only be used with dismissible = true');
Expand Down Expand Up @@ -120,6 +123,7 @@ Future<DateTime?> showMonthPicker({
theme: theme,
useMaterial3: theme.useMaterial3,
textScaleFactor: textScaleFactor,
arrowSize: arrowSize,
);
final DateTime? dialogDate = await showDialog<DateTime>(
context: context,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/helpers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class MonthpickerController {
required this.theme,
required this.useMaterial3,
this.textScaleFactor,
this.arrowSize,
});

//User defined variables
Expand All @@ -55,7 +56,7 @@ class MonthpickerController {
unselectedMonthTextColor,
backgroundColor;
final Widget? confirmWidget, cancelWidget;
final double? customHeight, customWidth, textScaleFactor;
final double? customHeight, customWidth, textScaleFactor, arrowSize;
final double roundedCornersRadius, selectedMonthPadding;
final int animationMilliseconds;

Expand Down
4 changes: 4 additions & 0 deletions lib/src/month_picker_widgets/header/header_arrows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ class HeaderArrows extends StatelessWidget {
const HeaderArrows({
super.key,
this.arrowcolors,
this.arrowSize,
required this.onUpButtonPressed,
required this.onDownButtonPressed,
required this.upState,
required this.downState,
});
final Color? arrowcolors;
final double? arrowSize;
final VoidCallback onUpButtonPressed, onDownButtonPressed;
final bool upState, downState;

Expand All @@ -21,13 +23,15 @@ class HeaderArrows extends StatelessWidget {
icon: Icon(
Icons.keyboard_arrow_up,
color: upState ? arrowcolors : arrowcolors!.withOpacity(0.5),
size: arrowSize,
),
onPressed: upState ? onUpButtonPressed : null,
),
IconButton(
icon: Icon(
Icons.keyboard_arrow_down,
color: downState ? arrowcolors : arrowcolors!.withOpacity(0.5),
size: arrowSize,
),
onPressed: downState ? onDownButtonPressed : null,
),
Expand Down
2 changes: 2 additions & 0 deletions lib/src/month_picker_widgets/header/header_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class HeaderRow extends StatelessWidget {
onDownButtonPressed: controller.onDownButtonPressed,
downState: monthProvider.enableState.downState,
upState: monthProvider.enableState.upState,
arrowSize: controller.arrowSize,
),
] else ...<Widget>[
Row(
Expand Down Expand Up @@ -86,6 +87,7 @@ class HeaderRow extends StatelessWidget {
onDownButtonPressed: controller.onDownButtonPressed,
downState: yearProvider.enableState.downState,
upState: yearProvider.enableState.upState,
arrowSize: controller.arrowSize,
),
]
],
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: 2.3.0
version: 2.4.0
homepage: https://github.com/hmkrivoj/month_picker_dialog

environment:
Expand Down

0 comments on commit a3abbda

Please sign in to comment.