Update SnackBar.onVisible documentation (#162448)

## Description

This PR updated `SnackBar.onVisible` documentation to explain why it can
be call several times.

## Related Issue

Fixes [Snackbar onVisible is called
twice](https://github.com/flutter/flutter/issues/162377)

## Tests

Documentation only
This commit is contained in:
Bruno Leroux 2025-02-04 14:29:29 +01:00 committed by GitHub
parent e0aae0d4b2
commit 5b29db924b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -464,6 +464,13 @@ class SnackBar extends StatefulWidget {
final Animation<double>? animation;
/// Called the first time that the snackbar is visible within a [Scaffold].
///
/// When multiple [Scaffold]s are registered to the same [ScaffoldMessengerState],
/// [onVisible] is called once for each scaffold.
///
/// See also:
///
/// * [ScaffoldMessenger], which manages [SnackBar]s for [Scaffold] descendants.
final VoidCallback? onVisible;
/// The direction in which the SnackBar can be dismissed.