Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Macacoazul01 committed Dec 14, 2024
1 parent 6cea26d commit ae05cb9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
7 changes: 5 additions & 2 deletions lib/src/month_picker_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ class MonthPickerDialogState extends State<MonthPickerDialog> {
theme: widget.controller.theme,
controller: widget.controller,
),
if (widget.controller.monthPickerDialogSettings.actionBarSettings.customDivider != null)
widget.controller.monthPickerDialogSettings.actionBarSettings.customDivider!,
if (widget.controller.monthPickerDialogSettings.actionBarSettings
.customDivider !=
null)
widget.controller.monthPickerDialogSettings.actionBarSettings
.customDivider!,
PickerActionBar(
controller: widget.controller,
),
Expand Down
9 changes: 6 additions & 3 deletions lib/src/month_picker_widgets/action_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@ class PickerActionBar extends StatelessWidget {
.monthPickerDialogSettings.dialogSettings.textScaleFactor!)
: null;
return OverflowBar(
spacing: controller.monthPickerDialogSettings.actionBarSettings.buttonSpacing,
spacing:
controller.monthPickerDialogSettings.actionBarSettings.buttonSpacing,
children: <Widget>[
TextButton(
onPressed: () => controller.cancelFunction(context),
child: controller.monthPickerDialogSettings.actionBarSettings.cancelWidget ??
child: controller
.monthPickerDialogSettings.actionBarSettings.cancelWidget ??
Text(
localizations.cancelButtonLabel,
textScaler: scaler,
),
),
TextButton(
onPressed: () => controller.okFunction(context),
child: controller.monthPickerDialogSettings.actionBarSettings.confirmWidget ??
child: controller
.monthPickerDialogSettings.actionBarSettings.confirmWidget ??
Text(
localizations.okButtonLabel,
textScaler: scaler,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/month_picker_widgets/header/header_arrows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class HeaderArrows extends StatelessWidget {
IconButton(
icon: Icon(
nextIcon ?? Icons.keyboard_arrow_down,
color: downState ? arrowcolors : arrowcolors!.withValues(alpha: 0.5),
color:
downState ? arrowcolors : arrowcolors!.withValues(alpha: 0.5),
size: arrowSize,
),
onPressed: downState ? onDownButtonPressed : null,
Expand Down
11 changes: 6 additions & 5 deletions lib/src/month_selector/month_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class MonthButton extends StatelessWidget {
/// If not provided, the customization will be built from the app's theme.
ButtonStyle _buildDefaultMonthStyle() {
Color? backgroundColor;
Color? foregroundColor = controller
.monthPickerDialogSettings.dateButtonsSettings.unselectedMonthsTextColor;
Color? foregroundColor = controller.monthPickerDialogSettings
.dateButtonsSettings.unselectedMonthsTextColor;
final List<DateTime> selectedDates = [];

if (controller.rangeMode) {
Expand Down Expand Up @@ -106,11 +106,12 @@ class MonthButton extends StatelessWidget {
}

return TextButton.styleFrom(
textStyle:
controller.monthPickerDialogSettings.dateButtonsSettings.monthTextStyle,
textStyle: controller
.monthPickerDialogSettings.dateButtonsSettings.monthTextStyle,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
shape: controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder,
shape:
controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder,
);
}

Expand Down
7 changes: 4 additions & 3 deletions lib/src/year_selector/year_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class YearButton extends StatelessWidget {
.dateButtonsSettings.selectedMonthBackgroundColor ??
theme.colorScheme.secondary;
final ButtonStyle yearStyle = TextButton.styleFrom(
textStyle:
controller.monthPickerDialogSettings.dateButtonsSettings.yearTextStyle,
textStyle: controller
.monthPickerDialogSettings.dateButtonsSettings.yearTextStyle,
foregroundColor: isTheSelectedYear
? theme.textTheme.labelLarge!
.copyWith(
Expand All @@ -78,7 +78,8 @@ class YearButton extends StatelessWidget {
: controller.monthPickerDialogSettings.dateButtonsSettings
.unselectedYearsTextColor,
backgroundColor: isTheSelectedYear ? backgroundColor : null,
shape: controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder,
shape:
controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder,
);
return yearStyle;
}
Expand Down
3 changes: 2 additions & 1 deletion test/month_picker_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ void main() {
controller.firstPossibleMonth(2120);
expect(controller.selectedDate, DateTime(2120, 2));
expect(
controller.monthPickerDialogSettings.dateButtonsSettings.selectedDateRadius,
controller
.monthPickerDialogSettings.dateButtonsSettings.selectedDateRadius,
1);
expect(controller.monthPickerDialogSettings.dialogSettings.forcePortrait,
true);
Expand Down

0 comments on commit ae05cb9

Please sign in to comment.