From 6cea26dbe3c36dae0cdbd09179c7686f88bfd34c Mon Sep 17 00:00:00 2001 From: Gianluca Bettega Date: Sat, 14 Dec 2024 12:07:23 -0300 Subject: [PATCH] 6.0.0 --- CHANGELOG.md | 5 ++ example/lib/main.dart | 70 ++++++++++--------- lib/month_picker_dialog.dart | 5 +- lib/src/helpers/controller.dart | 4 -- .../helpers/settings/action_bar_settings.dart | 34 +++++++++ ...ttings.dart => date_buttons_settings.dart} | 6 +- .../settings/month_picker_settings.dart | 10 ++- lib/src/month_picker_dialog.dart | 6 +- .../{button_bar.dart => action_bar.dart} | 9 +-- lib/src/month_selector/month_button.dart | 18 ++--- lib/src/pickers/show_month_picker.dart | 12 ---- lib/src/pickers/show_month_range_picker.dart | 12 ---- lib/src/pickers/show_year_picker.dart | 12 ---- lib/src/year_selector/year_button.dart | 14 ++-- pubspec.yaml | 2 +- test/month_picker_dialog_test.dart | 4 +- 16 files changed, 117 insertions(+), 106 deletions(-) create mode 100644 lib/src/helpers/settings/action_bar_settings.dart rename lib/src/helpers/settings/{buttons_settings.dart => date_buttons_settings.dart} (94%) rename lib/src/month_picker_widgets/{button_bar.dart => action_bar.dart} (77%) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb83a1e..21ca35b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.0.0 - 2024-12-14 +- Added `PickerActionBarSettings` to handle the action bar settings of the dialog. +- [Breaking] `confirmWidget`, `cancelWidget`, `customDivider` are now on the `PickerActionBarSettings` class. +- [Breaking] renamed `PickerButtonsSettings` to `PickerDateButtonsSettings` and `buttonsSettings` to `dateButtonsSettings`. + ## 5.2.0 - 2024-12-14 - Bumped intl to `0.20.0`. Fixes [#107](https://github.com/Macacoazul01/month_picker_dialog/issues/107). - Bumped flutter_lints to `5.0.0`. diff --git a/example/lib/main.dart b/example/lib/main.dart index 9efe331..2c8d07c 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -92,25 +92,27 @@ class _MyAppState extends State { } return null; }, - confirmWidget: Text( - 'This one!', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.indigo[300], - ), - ), - cancelWidget: Text( - 'Cancel', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.red[900], - ), - ), - monthPickerDialogSettings: const MonthPickerDialogSettings( - headerSettings: PickerHeaderSettings( + monthPickerDialogSettings: MonthPickerDialogSettings( + headerSettings: const PickerHeaderSettings( headerCurrentPageTextStyle: TextStyle(fontSize: 14), headerSelectedIntervalTextStyle: TextStyle(fontSize: 16), ), + actionBarSettings: PickerActionBarSettings( + confirmWidget: Text( + 'This one!', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.indigo[300], + ), + ), + cancelWidget: Text( + 'Cancel', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.red[900], + ), + ), + ), ), ).then((DateTime? date) { if (date != null) { @@ -144,20 +146,6 @@ class _MyAppState extends State { lastDate: DateTime(DateTime.now().year + 8, 9), initialRangeDate: DateTime(DateTime.now().year - 1, 5), endRangeDate: DateTime(DateTime.now().year - 1, 7), - confirmWidget: Text( - 'This one!', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.indigo[300], - ), - ), - cancelWidget: Text( - 'Cancel', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.red[900], - ), - ), headerTitle: const Text('Month Picker Dialog'), monthPickerDialogSettings: MonthPickerDialogSettings( dialogSettings: PickerDialogSettings( @@ -165,6 +153,22 @@ class _MyAppState extends State { dialogRoundedCornersRadius: 20, dialogBackgroundColor: Colors.blueGrey[50], ), + actionBarSettings: PickerActionBarSettings( + confirmWidget: Text( + 'This one!', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.indigo[300], + ), + ), + cancelWidget: Text( + 'Cancel', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.red[900], + ), + ), + ), headerSettings: PickerHeaderSettings( headerBackgroundColor: Colors.indigo[300], headerSelectedIntervalTextStyle: const TextStyle( @@ -178,7 +182,7 @@ class _MyAppState extends State { previousIcon: Icons.arrow_back, nextIcon: Icons.arrow_forward, ), - buttonsSettings: PickerButtonsSettings( + dateButtonsSettings: PickerDateButtonsSettings( buttonBorder: const RoundedRectangleBorder(), selectedMonthBackgroundColor: Colors.amber[900], selectedMonthTextColor: Colors.white, @@ -197,7 +201,9 @@ class _MyAppState extends State { ).then((List? dates) { if (dates != null) { print(dates); - print(dates.last.lastDayOfMonth()); + if (dates.isNotEmpty) { + print(dates.last.lastDayOfMonth()); + } } }); } diff --git a/lib/month_picker_dialog.dart b/lib/month_picker_dialog.dart index d4cd5cb..f9da0ea 100644 --- a/lib/month_picker_dialog.dart +++ b/lib/month_picker_dialog.dart @@ -9,9 +9,10 @@ export '/src/helpers/providers.dart'; export '/src/helpers/settings/dialog_settings.dart'; export '/src/helpers/settings/month_picker_settings.dart'; export '/src/helpers/settings/header_settings.dart'; -export '/src/helpers/settings/buttons_settings.dart'; +export '/src/helpers/settings/date_buttons_settings.dart'; +export '/src/helpers/settings/action_bar_settings.dart'; export '/src/month_picker_dialog.dart'; -export '/src/month_picker_widgets/button_bar.dart'; +export 'src/month_picker_widgets/action_bar.dart'; export '/src/month_picker_widgets/header/header.dart'; export '/src/month_picker_widgets/header/header_arrows.dart'; export '/src/month_picker_widgets/header/header_row.dart'; diff --git a/lib/src/helpers/controller.dart b/lib/src/helpers/controller.dart index c709dd9..90d795e 100644 --- a/lib/src/helpers/controller.dart +++ b/lib/src/helpers/controller.dart @@ -15,11 +15,8 @@ class MonthpickerController { this.selectableYearPredicate, this.monthStylePredicate, this.yearStylePredicate, - this.confirmWidget, - this.cancelWidget, required this.theme, required this.useMaterial3, - this.customDivider, this.headerTitle, this.rangeMode = false, this.rangeList = false, @@ -35,7 +32,6 @@ class MonthpickerController { final ButtonStyle? Function(DateTime)? monthStylePredicate; final ButtonStyle? Function(int)? yearStylePredicate; final bool useMaterial3, rangeMode, rangeList, onlyYear; - final Widget? confirmWidget, cancelWidget, customDivider; final Widget? headerTitle; final MonthPickerDialogSettings monthPickerDialogSettings; diff --git a/lib/src/helpers/settings/action_bar_settings.dart b/lib/src/helpers/settings/action_bar_settings.dart new file mode 100644 index 0000000..26ca53c --- /dev/null +++ b/lib/src/helpers/settings/action_bar_settings.dart @@ -0,0 +1,34 @@ +import 'package:flutter/widgets.dart'; + +///Class to hold all the customizations of the action bar part of the package. +class PickerActionBarSettings { + const PickerActionBarSettings({ + this.buttonSpacing = 0, + this.confirmWidget, + this.cancelWidget, + this.customDivider, + }); + + /// The size of the current selected month/year circle. + /// + /// default: `0` + final double buttonSpacing; + + ///The custom confirm widget of the dialog. + /// + /// default: `null` + final Widget? confirmWidget; + + ///The custom cancel widget of the dialog. + /// + /// default: `null` + final Widget? cancelWidget; + + ///The custom divider between the months/years and the confirm/cancel buttons. + /// + /// default: `null` + final Widget? customDivider; +} + +///The default settings for the buttons style. +const defaultPickerActionBarSettings = PickerActionBarSettings(); diff --git a/lib/src/helpers/settings/buttons_settings.dart b/lib/src/helpers/settings/date_buttons_settings.dart similarity index 94% rename from lib/src/helpers/settings/buttons_settings.dart rename to lib/src/helpers/settings/date_buttons_settings.dart index 87798da..4644b6c 100644 --- a/lib/src/helpers/settings/buttons_settings.dart +++ b/lib/src/helpers/settings/date_buttons_settings.dart @@ -1,8 +1,8 @@ import 'package:flutter/widgets.dart'; ///Class to hold all the customizations of the buttons part of the package. -class PickerButtonsSettings { - const PickerButtonsSettings({ +class PickerDateButtonsSettings { + const PickerDateButtonsSettings({ this.monthTextStyle, TextStyle? yearTextStyle, this.selectedMonthBackgroundColor, @@ -77,4 +77,4 @@ class PickerButtonsSettings { } ///The default settings for the buttons style. -const defaultPickerbuttonsSettings = PickerButtonsSettings(); +const defaultPickerDateButtonsSettings = PickerDateButtonsSettings(); diff --git a/lib/src/helpers/settings/month_picker_settings.dart b/lib/src/helpers/settings/month_picker_settings.dart index 004119f..9970a32 100644 --- a/lib/src/helpers/settings/month_picker_settings.dart +++ b/lib/src/helpers/settings/month_picker_settings.dart @@ -5,7 +5,8 @@ class MonthPickerDialogSettings { const MonthPickerDialogSettings({ this.dialogSettings = defaultPickerdialogSettings, this.headerSettings = defaultPickerHeaderSettings, - this.buttonsSettings = defaultPickerbuttonsSettings, + this.dateButtonsSettings = defaultPickerDateButtonsSettings, + this.actionBarSettings = defaultPickerActionBarSettings, }); ///The customizations of the dialog part of the package. @@ -14,8 +15,11 @@ class MonthPickerDialogSettings { ///The customizations of the header part of the package. final PickerHeaderSettings headerSettings; - ///The customizations of the buttons part of the package. - final PickerButtonsSettings buttonsSettings; + ///The customizations of the date buttons part of the package. + final PickerDateButtonsSettings dateButtonsSettings; + + ///The customizations of the date buttons part of the package. + final PickerActionBarSettings actionBarSettings; } ///The default settings for the month picker. diff --git a/lib/src/month_picker_dialog.dart b/lib/src/month_picker_dialog.dart index 471012f..8acfa1c 100644 --- a/lib/src/month_picker_dialog.dart +++ b/lib/src/month_picker_dialog.dart @@ -85,9 +85,9 @@ class MonthPickerDialogState extends State { theme: widget.controller.theme, controller: widget.controller, ), - if (widget.controller.customDivider != null) - widget.controller.customDivider!, - PickerButtonBar( + if (widget.controller.monthPickerDialogSettings.actionBarSettings.customDivider != null) + widget.controller.monthPickerDialogSettings.actionBarSettings.customDivider!, + PickerActionBar( controller: widget.controller, ), ], diff --git a/lib/src/month_picker_widgets/button_bar.dart b/lib/src/month_picker_widgets/action_bar.dart similarity index 77% rename from lib/src/month_picker_widgets/button_bar.dart rename to lib/src/month_picker_widgets/action_bar.dart index a98764f..9e7fb6e 100644 --- a/lib/src/month_picker_widgets/button_bar.dart +++ b/lib/src/month_picker_widgets/action_bar.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import '/month_picker_dialog.dart'; ///The actions button bar. Where confirmation and cancel button are. -class PickerButtonBar extends StatelessWidget { - const PickerButtonBar({ +class PickerActionBar extends StatelessWidget { + const PickerActionBar({ super.key, required this.controller, }); @@ -20,10 +20,11 @@ class PickerButtonBar extends StatelessWidget { .monthPickerDialogSettings.dialogSettings.textScaleFactor!) : null; return OverflowBar( + spacing: controller.monthPickerDialogSettings.actionBarSettings.buttonSpacing, children: [ TextButton( onPressed: () => controller.cancelFunction(context), - child: controller.cancelWidget ?? + child: controller.monthPickerDialogSettings.actionBarSettings.cancelWidget ?? Text( localizations.cancelButtonLabel, textScaler: scaler, @@ -31,7 +32,7 @@ class PickerButtonBar extends StatelessWidget { ), TextButton( onPressed: () => controller.okFunction(context), - child: controller.confirmWidget ?? + child: controller.monthPickerDialogSettings.actionBarSettings.confirmWidget ?? Text( localizations.okButtonLabel, textScaler: scaler, diff --git a/lib/src/month_selector/month_button.dart b/lib/src/month_selector/month_button.dart index 05cde24..c81b452 100644 --- a/lib/src/month_selector/month_button.dart +++ b/lib/src/month_selector/month_button.dart @@ -52,7 +52,7 @@ class MonthButton extends StatelessWidget { ButtonStyle _buildDefaultMonthStyle() { Color? backgroundColor; Color? foregroundColor = controller - .monthPickerDialogSettings.buttonsSettings.unselectedMonthsTextColor; + .monthPickerDialogSettings.dateButtonsSettings.unselectedMonthsTextColor; final List selectedDates = []; if (controller.rangeMode) { @@ -69,14 +69,14 @@ class MonthButton extends StatelessWidget { if (date.isAfter(selectedDates[0]) && date.isBefore(selectedDates[1])) { backgroundColor = HSLColor.fromColor(controller .monthPickerDialogSettings - .buttonsSettings + .dateButtonsSettings .selectedMonthBackgroundColor ?? theme.colorScheme.secondary) .withLightness(.7) .toColor(); foregroundColor = theme.textTheme.labelLarge! .copyWith( - color: controller.monthPickerDialogSettings.buttonsSettings + color: controller.monthPickerDialogSettings.dateButtonsSettings .selectedMonthTextColor ?? theme.colorScheme.onSecondary, ) @@ -88,29 +88,29 @@ class MonthButton extends StatelessWidget { } if (selectedDates.contains(date)) { - backgroundColor = controller.monthPickerDialogSettings.buttonsSettings + backgroundColor = controller.monthPickerDialogSettings.dateButtonsSettings .selectedMonthBackgroundColor ?? theme.colorScheme.secondary; foregroundColor = theme.textTheme.labelLarge! .copyWith( - color: controller.monthPickerDialogSettings.buttonsSettings + color: controller.monthPickerDialogSettings.dateButtonsSettings .selectedMonthTextColor ?? theme.colorScheme.onSecondary, ) .color; } else if (date.month == controller.now.month && date.year == controller.now.year) { - foregroundColor = controller.monthPickerDialogSettings.buttonsSettings + foregroundColor = controller.monthPickerDialogSettings.dateButtonsSettings .currentMonthTextColor ?? backgroundColor; } return TextButton.styleFrom( textStyle: - controller.monthPickerDialogSettings.buttonsSettings.monthTextStyle, + controller.monthPickerDialogSettings.dateButtonsSettings.monthTextStyle, foregroundColor: foregroundColor, backgroundColor: backgroundColor, - shape: controller.monthPickerDialogSettings.buttonsSettings.buttonBorder, + shape: controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder, ); } @@ -129,7 +129,7 @@ class MonthButton extends StatelessWidget { return Padding( padding: EdgeInsets.all(controller - .monthPickerDialogSettings.buttonsSettings.selectedDateRadius), + .monthPickerDialogSettings.dateButtonsSettings.selectedDateRadius), child: TextButton( onPressed: isEnabled ? () => onMonthSelected(DateTime(date.year, date.month)) diff --git a/lib/src/pickers/show_month_picker.dart b/lib/src/pickers/show_month_picker.dart index 4bad05c..f25885b 100644 --- a/lib/src/pickers/show_month_picker.dart +++ b/lib/src/pickers/show_month_picker.dart @@ -19,12 +19,6 @@ import '/month_picker_dialog.dart'; /// /// `yearStylePredicate:` allows you to individually customize each year. /// -/// `confirmWidget:` lets you set a custom confirm widget. -/// -/// `cancelWidget:` lets you set a custom cancel widget. -/// -/// `customDivider:` lets you add a custom divider between the months/years and the confirm/cancel buttons. -/// /// `headerTitle:` lets you 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`). @@ -40,9 +34,6 @@ Future showMonthPicker({ bool Function(int)? selectableYearPredicate, ButtonStyle? Function(DateTime)? monthStylePredicate, ButtonStyle? Function(int)? yearStylePredicate, - Widget? confirmWidget, - Widget? cancelWidget, - Widget? customDivider, Widget? headerTitle, MonthPickerDialogSettings monthPickerDialogSettings = defaultMonthPickerDialogSettings, @@ -58,11 +49,8 @@ Future showMonthPicker({ selectableYearPredicate: selectableYearPredicate, monthStylePredicate: monthStylePredicate, yearStylePredicate: yearStylePredicate, - confirmWidget: confirmWidget, - cancelWidget: cancelWidget, theme: theme, useMaterial3: theme.useMaterial3, - customDivider: customDivider, headerTitle: headerTitle, onlyYear: onlyYear, ); diff --git a/lib/src/pickers/show_month_range_picker.dart b/lib/src/pickers/show_month_range_picker.dart index 8c9a498..2025cc2 100644 --- a/lib/src/pickers/show_month_range_picker.dart +++ b/lib/src/pickers/show_month_range_picker.dart @@ -21,12 +21,6 @@ import '/month_picker_dialog.dart'; /// /// `yearStylePredicate:` allows you to individually customize each year. /// -/// `confirmWidget:` lets you set a custom confirm widget. -/// -/// `cancelWidget:` lets you set a custom cancel widget. -/// -/// `customDivider:` lets you add a custom divider between the months/years and the confirm/cancel buttons. -/// /// `headerTitle:` lets you 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`). @@ -43,9 +37,6 @@ Future?> showMonthRangePicker({ bool Function(int)? selectableYearPredicate, ButtonStyle? Function(DateTime)? monthStylePredicate, ButtonStyle? Function(int)? yearStylePredicate, - Widget? confirmWidget, - Widget? cancelWidget, - Widget? customDivider, Widget? headerTitle, bool rangeList = false, MonthPickerDialogSettings monthPickerDialogSettings = @@ -61,11 +52,8 @@ Future?> showMonthRangePicker({ selectableYearPredicate: selectableYearPredicate, monthStylePredicate: monthStylePredicate, yearStylePredicate: yearStylePredicate, - confirmWidget: confirmWidget, - cancelWidget: cancelWidget, theme: theme, useMaterial3: theme.useMaterial3, - customDivider: customDivider, headerTitle: headerTitle, rangeMode: true, rangeList: rangeList, diff --git a/lib/src/pickers/show_year_picker.dart b/lib/src/pickers/show_year_picker.dart index 3b9d616..4176a31 100644 --- a/lib/src/pickers/show_year_picker.dart +++ b/lib/src/pickers/show_year_picker.dart @@ -14,12 +14,6 @@ import '/month_picker_dialog.dart'; /// /// `yearStylePredicate:` allows you to individually customize each year. /// -/// `confirmWidget:` lets you set a custom confirm widget. -/// -/// `cancelWidget:` lets you set a custom cancel widget. -/// -/// `customDivider:` lets you add a custom divider between the months/years and the confirm/cancel buttons. -/// /// `headerTitle:` lets you 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`). @@ -31,9 +25,6 @@ Future showYearPicker({ DateTime? lastDate, bool Function(int)? selectableYearPredicate, ButtonStyle? Function(int)? yearStylePredicate, - Widget? confirmWidget, - Widget? cancelWidget, - Widget? customDivider, Widget? headerTitle, MonthPickerDialogSettings monthPickerDialogSettings = defaultMonthPickerDialogSettings, @@ -45,9 +36,6 @@ Future showYearPicker({ lastDate: lastDate, selectableYearPredicate: selectableYearPredicate, yearStylePredicate: yearStylePredicate, - confirmWidget: confirmWidget, - cancelWidget: cancelWidget, - customDivider: customDivider, headerTitle: headerTitle, monthPickerDialogSettings: monthPickerDialogSettings, onlyYear: true, diff --git a/lib/src/year_selector/year_button.dart b/lib/src/year_selector/year_button.dart index cbec317..f936d70 100644 --- a/lib/src/year_selector/year_button.dart +++ b/lib/src/year_selector/year_button.dart @@ -58,27 +58,27 @@ class YearButton extends StatelessWidget { ButtonStyle _buildDefaultYearStyle(int year) { final bool isTheSelectedYear = year == controller.selectedDate.year; final Color backgroundColor = controller.monthPickerDialogSettings - .buttonsSettings.selectedMonthBackgroundColor ?? + .dateButtonsSettings.selectedMonthBackgroundColor ?? theme.colorScheme.secondary; final ButtonStyle yearStyle = TextButton.styleFrom( textStyle: - controller.monthPickerDialogSettings.buttonsSettings.yearTextStyle, + controller.monthPickerDialogSettings.dateButtonsSettings.yearTextStyle, foregroundColor: isTheSelectedYear ? theme.textTheme.labelLarge! .copyWith( - color: controller.monthPickerDialogSettings.buttonsSettings + color: controller.monthPickerDialogSettings.dateButtonsSettings .selectedYearTextColor ?? theme.colorScheme.onSecondary, ) .color : year == controller.now.year - ? (controller.monthPickerDialogSettings.buttonsSettings + ? (controller.monthPickerDialogSettings.dateButtonsSettings .currentYearTextColor ?? backgroundColor) - : controller.monthPickerDialogSettings.buttonsSettings + : controller.monthPickerDialogSettings.dateButtonsSettings .unselectedYearsTextColor, backgroundColor: isTheSelectedYear ? backgroundColor : null, - shape: controller.monthPickerDialogSettings.buttonsSettings.buttonBorder, + shape: controller.monthPickerDialogSettings.dateButtonsSettings.buttonBorder, ); return yearStyle; } @@ -103,7 +103,7 @@ class YearButton extends StatelessWidget { return Padding( padding: EdgeInsets.all(controller - .monthPickerDialogSettings.buttonsSettings.selectedDateRadius), + .monthPickerDialogSettings.dateButtonsSettings.selectedDateRadius), child: TextButton( onPressed: isEnabled ? () => onYearSelected(year) : null, style: yearStyle, diff --git a/pubspec.yaml b/pubspec.yaml index 9c32e45..0888a53 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: month_picker_dialog description: Internationalized dialog for picking a single month from an infinite list of years. -version: 5.2.0 +version: 6.0.0 homepage: https://github.com/hmkrivoj/month_picker_dialog environment: diff --git a/test/month_picker_dialog_test.dart b/test/month_picker_dialog_test.dart index e5b67d9..46373a1 100644 --- a/test/month_picker_dialog_test.dart +++ b/test/month_picker_dialog_test.dart @@ -38,7 +38,7 @@ void main() { monthPickerDialogSettings: const MonthPickerDialogSettings( dialogSettings: PickerDialogSettings( customHeight: 250, customWidth: 310, forcePortrait: true), - buttonsSettings: PickerButtonsSettings( + dateButtonsSettings: PickerDateButtonsSettings( monthTextStyle: TextStyle( fontWeight: FontWeight.bold, ), @@ -63,7 +63,7 @@ void main() { controller.firstPossibleMonth(2120); expect(controller.selectedDate, DateTime(2120, 2)); expect( - controller.monthPickerDialogSettings.buttonsSettings.selectedDateRadius, + controller.monthPickerDialogSettings.dateButtonsSettings.selectedDateRadius, 1); expect(controller.monthPickerDialogSettings.dialogSettings.forcePortrait, true);