From 73da3b53bd9186c0135a35d54f7bc740cf27f99f Mon Sep 17 00:00:00 2001 From: Ramon Farizel <45459898+RamonFarizel@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:09:13 -0300 Subject: [PATCH] Update Snackbar actionOverflowThreshold Documentation (#156926) This PR addresses an inconsistency in the snackbar widget documentation regarding the percentage threshold for action overflow. The current documentation states that setting the threshold to 0 will prevent the action from overflowing to a new line. However, this behavior is incorrect, as the action still wraps when the threshold is set to 0. To resolve this, we propose updating the documentation to clarify that the threshold should be set to 1 to ensure the action remains on the same line as the content. #156817 --- packages/flutter/lib/src/material/snack_bar.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index e0bb9845f4..f6e45bc3a7 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -422,11 +422,11 @@ class SnackBar extends StatefulWidget { /// (optional) The percentage threshold for action widget's width before it overflows /// to a new line. /// - /// Must be between 0 and 1. If the width of the snackbar's [content] is greater - /// than this percentage of the width of the snackbar less the width of its [action], - /// then the [action] will appear below the [content]. + /// Must be between 0 and 1. + /// If the width of the [action] divided by the total snackbar width + /// is greater than this percentage, the [action] will appear below the [content]. /// - /// At a value of 0, the action will not overflow to a new line. + /// At a value of 0, the action will always overflow to a new line. /// /// Defaults to 0.25. final double? actionOverflowThreshold;