Skip to content

Commit

Permalink
update PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Macacoazul01 committed May 13, 2024
1 parent 7309a7a commit 445cdf4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _MyAppState extends State<MyApp> {
roundedCornersRadius: 20,
yearFirst: true,
backgroundColor: Colors.blueGrey[50],
outlinedBorder: RoundedRectangleBorder(),
buttonBorder: RoundedRectangleBorder(),
headerTitle: Text('Month Picker Dialog'),
// customDivider: Divider(
// color: Colors.black,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/helpers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MonthpickerController {
this.customDivider,
required this.blockScrolling,
required this.dialogBorderSide,
required this.outlinedBorder,
required this.buttonBorder,
required this.headerTitle,
});

Expand Down Expand Up @@ -68,7 +68,7 @@ class MonthpickerController {
final double roundedCornersRadius, selectedMonthPadding, customWidth;
final int animationMilliseconds;
final BorderSide dialogBorderSide;
final OutlinedBorder outlinedBorder;
final OutlinedBorder buttonBorder;
final Widget? headerTitle;

//local variables
Expand Down
1 change: 0 additions & 1 deletion lib/src/month_picker_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class MonthPickerDialogState extends State<MonthPickerDialog> {
onSelectYear: _onSelectYear,
portrait: portrait,
controller: widget.controller,
headerTitle: widget.controller.headerTitle,
);

return Theme(
Expand Down
4 changes: 1 addition & 3 deletions lib/src/month_picker_widgets/header/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ class PickerHeader extends StatelessWidget {
required this.onSelectYear,
required this.portrait,
required this.controller,
required this.headerTitle,
});
final ThemeData theme;
final String localeString;
final bool isMonthSelector, portrait;
final VoidCallback onSelectYear;
final MonthpickerController controller;
final Widget? headerTitle;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -54,7 +52,7 @@ class PickerHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (headerTitle != null) headerTitle!,
if (controller.headerTitle != null) controller.headerTitle!,
HeaderSelectedDate(
theme: theme,
localeString: localeString,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/month_selector/month_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class MonthButton extends StatelessWidget {
date.year == controller.selectedDate.year
? backgroundColor
: null,
shape: controller.outlinedBorder,
shape: controller.buttonBorder,
);
return monthStyle;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/show_month_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Future<DateTime?> showMonthPicker(
Widget? customDivider,
bool blockScrolling = true,
BorderSide dialogBorderSide = BorderSide.none,
OutlinedBorder outlinedBorder = const CircleBorder(),
OutlinedBorder buttonBorder = const CircleBorder(),
Widget? headerTitle = null,
}) async {
assert(forceSelectedDate == dismissible || !forceSelectedDate,
Expand Down Expand Up @@ -139,7 +139,7 @@ Future<DateTime?> showMonthPicker(
customDivider: customDivider,
blockScrolling: blockScrolling,
dialogBorderSide: dialogBorderSide,
outlinedBorder: outlinedBorder,
buttonBorder: buttonBorder,
headerTitle: headerTitle,
);
final DateTime? dialogDate = await showDialog<DateTime>(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/year_selector/year_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class YearButton extends StatelessWidget {
: controller.unselectedMonthTextColor,
backgroundColor:
year == controller.selectedDate.year ? backgroundColor : null,
shape: controller.outlinedBorder,
shape: controller.buttonBorder,
);
return yearStyle;
}
Expand Down
4 changes: 2 additions & 2 deletions test/month_picker_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
customWidth: 320,
blockScrolling: false,
dialogBorderSide: BorderSide.none,
outlinedBorder: const CircleBorder(),
buttonBorder: const CircleBorder(),
headerTitle: null,
);
controller.initialize();
Expand Down Expand Up @@ -55,7 +55,7 @@ void main() {
forcePortrait: true,
blockScrolling: false,
dialogBorderSide: BorderSide.none,
outlinedBorder: const CircleBorder(),
buttonBorder: const CircleBorder(),
headerTitle: null,
);
controller.initialize();
Expand Down

0 comments on commit 445cdf4

Please sign in to comment.