Skip to content

Commit 5a427d0

Browse files
committed
feat: expose route settings on all apis
1 parent b1fc3fb commit 5a427d0

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

lib/src/alert_dialog/show_alert_dialog.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Future<T?> showAlertDialog<T>({
2828
WillPopCallback? onWillPop,
2929
AdaptiveDialogBuilder? builder,
3030
Widget? macOSApplicationIcon,
31+
RouteSettings? routeSettings,
3132
}) {
3233
void pop(T? key) => Navigator.of(
3334
context,
@@ -48,6 +49,7 @@ Future<T?> showAlertDialog<T>({
4849
useRootNavigator: useRootNavigator,
4950
onWillPop: onWillPop,
5051
builder: builder,
52+
routeSettings: routeSettings,
5153
);
5254
}
5355
final titleText = title == null ? null : Text(title);
@@ -61,6 +63,7 @@ Future<T?> showAlertDialog<T>({
6163
return showCupertinoDialog(
6264
context: context,
6365
useRootNavigator: useRootNavigator,
66+
routeSettings: routeSettings,
6467
builder: (context) {
6568
final dialog = WillPopScope(
6669
onWillPop: onWillPop,
@@ -95,6 +98,7 @@ Future<T?> showAlertDialog<T>({
9598
return showMacosAlertDialog(
9699
context: context,
97100
useRootNavigator: useRootNavigator,
101+
routeSettings: routeSettings,
98102
builder: (context) {
99103
final Widget dialog = MacThemeWrapper(
100104
child: WillPopScope(
@@ -119,6 +123,7 @@ Future<T?> showAlertDialog<T>({
119123
return showModal(
120124
context: context,
121125
useRootNavigator: useRootNavigator,
126+
routeSettings: routeSettings,
122127
configuration: FadeScaleTransitionConfiguration(
123128
barrierDismissible: barrierDismissible,
124129
),

lib/src/alert_dialog/show_confirmation_dialog.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Future<T?> showConfirmationDialog<T>({
2929
bool fullyCapitalizedForMaterial = true,
3030
WillPopCallback? onWillPop,
3131
AdaptiveDialogBuilder? builder,
32+
RouteSettings? routeSettings,
3233
}) {
3334
void pop(T? key) => Navigator.of(
3435
context,
@@ -40,6 +41,7 @@ Future<T?> showConfirmationDialog<T>({
4041
? showModal(
4142
context: context,
4243
useRootNavigator: useRootNavigator,
44+
routeSettings: routeSettings,
4345
configuration: FadeScaleTransitionConfiguration(
4446
barrierDismissible: barrierDismissible,
4547
),
@@ -70,6 +72,7 @@ Future<T?> showConfirmationDialog<T>({
7072
useRootNavigator: useRootNavigator,
7173
onWillPop: onWillPop,
7274
builder: builder,
75+
routeSettings: routeSettings,
7376
);
7477
}
7578

lib/src/alert_dialog/show_ok_alert_dialog.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ Future<OkCancelResult> showOkAlertDialog({
2323
bool fullyCapitalizedForMaterial = true,
2424
WillPopCallback? onWillPop,
2525
AdaptiveDialogBuilder? builder,
26+
RouteSettings? routeSettings,
2627
}) async {
2728
final theme = Theme.of(context);
2829
final adaptiveStyle = style ?? AdaptiveDialog.instance.defaultStyle;
2930
final isMacOS = adaptiveStyle.effectiveStyle(theme) == AdaptiveStyle.macOS;
3031
final result = await showAlertDialog<OkCancelResult>(
32+
routeSettings: routeSettings,
3133
context: context,
3234
title: title,
3335
message: message,

lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Future<OkCancelResult> showOkCancelAlertDialog({
3030
bool fullyCapitalizedForMaterial = true,
3131
WillPopCallback? onWillPop,
3232
AdaptiveDialogBuilder? builder,
33+
RouteSettings? routeSettings,
3334
}) async {
3435
final theme = Theme.of(context);
3536
final adaptiveStyle = style ?? AdaptiveDialog.instance.defaultStyle;
@@ -40,6 +41,7 @@ Future<OkCancelResult> showOkCancelAlertDialog({
4041
}
4142

4243
final result = await showAlertDialog<OkCancelResult>(
44+
routeSettings: routeSettings,
4345
context: context,
4446
title: title,
4547
message: message,

lib/src/modal_action_sheet/modal_action_sheet.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Future<T?> showModalActionSheet<T>({
2323
MaterialModalActionSheetConfiguration? materialConfiguration,
2424
WillPopCallback? onWillPop,
2525
AdaptiveDialogBuilder? builder,
26+
RouteSettings? routeSettings,
2627
}) {
2728
void pop(T? key) => Navigator.of(
2829
context,
@@ -36,6 +37,7 @@ Future<T?> showModalActionSheet<T>({
3637
isScrollControlled: materialConfiguration != null,
3738
isDismissible: isDismissible,
3839
useRootNavigator: useRootNavigator,
40+
routeSettings: routeSettings,
3941
builder: (context) {
4042
final sheet = MaterialModalActionSheet(
4143
onPressed: pop,
@@ -51,6 +53,7 @@ Future<T?> showModalActionSheet<T>({
5153
: showCupertinoModalPopup(
5254
context: context,
5355
useRootNavigator: useRootNavigator,
56+
routeSettings: routeSettings,
5457
builder: (context) {
5558
final sheet = CupertinoModalActionSheet(
5659
onPressed: pop,

lib/src/text_input_dialog/show_text_input_dialog.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Future<List<String>?> showTextInputDialog({
2525
WillPopCallback? onWillPop,
2626
bool autoSubmit = false,
2727
AdaptiveDialogBuilder? builder,
28+
RouteSettings? routeSettings,
2829
}) {
2930
final theme = Theme.of(context);
3031
final adaptiveStyle = style ?? AdaptiveDialog.instance.defaultStyle;
@@ -36,6 +37,7 @@ Future<List<String>?> showTextInputDialog({
3637
return showCupertinoDialog(
3738
context: context,
3839
useRootNavigator: useRootNavigator,
40+
routeSettings: routeSettings,
3941
builder: (context) {
4042
final dialog = IOSTextInputDialog(
4143
textFields: textFields,
@@ -54,6 +56,8 @@ Future<List<String>?> showTextInputDialog({
5456
);
5557
case AdaptiveStyle.macOS:
5658
return showMacosAlertDialog(
59+
routeSettings: routeSettings,
60+
useRootNavigator: useRootNavigator,
5761
context: context,
5862
builder: (context) {
5963
final dialog = MacThemeWrapper(
@@ -77,6 +81,7 @@ Future<List<String>?> showTextInputDialog({
7781
return showModal(
7882
context: context,
7983
useRootNavigator: useRootNavigator,
84+
routeSettings: routeSettings,
8085
configuration: FadeScaleTransitionConfiguration(
8186
barrierDismissible: barrierDismissible,
8287
),

0 commit comments

Comments
 (0)