diff --git a/packages/flutter/lib/src/widgets/size_changed_layout_notifier.dart b/packages/flutter/lib/src/widgets/size_changed_layout_notifier.dart index b1e14516fb3..622684c89e8 100644 --- a/packages/flutter/lib/src/widgets/size_changed_layout_notifier.dart +++ b/packages/flutter/lib/src/widgets/size_changed_layout_notifier.dart @@ -9,12 +9,26 @@ import 'package:flutter/widgets.dart'; /// this notification has changed, and that therefore any assumptions about that /// layout are no longer valid. /// +/// For example, sent by [SizeChangedLayoutNotifier] whenever +/// [SizeChangedLayoutNotifier] changes size. +/// +/// This notification for triggering repaints, but if you use this notification +/// to trigger rebuilds or relayouts, you'll create a backwards dependency in +/// the frame pipeline because [SizeChangedLayoutNotification]s are generated +/// during layout, which is after the build phase and in the middle of the +/// layout phase. This backwards dependency can lead to visual corruption or +/// lags. +/// /// See [LayoutChangedNotification] for additional discussion of layout /// notifications such as this one. +/// +/// See also: +/// +/// * [SizeChangedLayoutNotifier], which sends this notification. class SizeChangedLayoutNotification extends LayoutChangedNotification { } -/// A widget that automatically dispatches a [SizeChangedLayoutNotifier] when -/// the layout of its child changes. +/// A widget that automatically dispatches a [SizeChangedLayoutNotification] +/// when the layout of its child changes. /// /// Useful especially when having some complex, layout-changing animation within /// [Material] that is also interactive.