From af0e01c37095b3de9f47fef5956838aa6414db09 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 18 Jul 2024 09:22:18 -0700 Subject: [PATCH] Fix AppBar doc to keep diagram next to its description (#151937) Also swap two paragraphs to keep related content together. --- packages/flutter/lib/src/material/app_bar.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 03bff3ac94..adc5a1a3c3 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -92,13 +92,6 @@ class _PreferredAppBarSize extends Size { /// appears in the toolbar when the writing language is left-to-right (e.g. /// English): /// -/// The [AppBar] insets its content based on the ambient [MediaQuery]'s padding, -/// to avoid system UI intrusions. It's taken care of by [Scaffold] when used in -/// the [Scaffold.appBar] property. When animating an [AppBar], unexpected -/// [MediaQuery] changes (as is common in [Hero] animations) may cause the content -/// to suddenly jump. Wrap the [AppBar] in a [MediaQuery] widget, and adjust its -/// padding such that the animation is smooth. -/// /// ![The leading widget is in the top left, the actions are in the top right, /// the title is between them. The bottom is, naturally, at the bottom, and the /// flexibleSpace is behind all of them.](https://flutter.github.io/assets-for-api-docs/assets/material/app_bar.png) @@ -110,6 +103,13 @@ class _PreferredAppBarSize extends Size { /// to false. In that case a null leading widget will result in the middle/title widget /// stretching to start. /// +/// The [AppBar] insets its content based on the ambient [MediaQuery]'s padding, +/// to avoid system UI intrusions. It's taken care of by [Scaffold] when used in +/// the [Scaffold.appBar] property. When animating an [AppBar], unexpected +/// [MediaQuery] changes (as is common in [Hero] animations) may cause the content +/// to suddenly jump. Wrap the [AppBar] in a [MediaQuery] widget, and adjust its +/// padding such that the animation is smooth. +/// /// {@tool dartpad} /// This sample shows an [AppBar] with two simple actions. The first action /// opens a [SnackBar], while the second action navigates to a new page.