You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrap diagrams and transparent images with background (#11891)
By adding a `.diagram-wrap` CSS class that can be added to images as
needed.
To improve legibility in dark mode and visual separation in light mode.
Contributes to #11883
Copy file name to clipboardExpand all lines: src/content/data-and-backend/state-mgmt/declarative.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ it. Flutter is fast enough to do that, even on every frame if needed.
20
20
Flutter is _declarative_. This means that Flutter builds its user interface to
21
21
reflect the current state of your app:
22
22
23
-
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/ui-equals-function-of-state.png'width="100%"alt="A mathematical formula of UI = f(state). 'UI' is the layout on the screen. 'f' is your build methods. 'state' is the application state.">
23
+
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/ui-equals-function-of-state.png'width="100%"class="diagram-wrap"alt="A mathematical formula of UI = f(state). 'UI' is the layout on the screen. 'f' is your build methods. 'state' is the application state.">
24
24
25
25
{% comment %}
26
26
Source drawing for the png above: : https://docs.google.com/drawings/d/1RDcR5LyFtzhpmiT5-UupXBeos2Ban5cUTU0-JujS3Os/edit?usp=sharing
Copy file name to clipboardExpand all lines: src/content/data-and-backend/state-mgmt/ephemeral-vs-app.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ it might need to be moved to app state.
122
122
123
123
For that reason, take the following diagram with a large grain of salt:
124
124
125
-
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/ephemeral-vs-app-state.png'width="100%"alt="A flow chart. Start with 'Data'. 'Who needs it?'. Three options: 'Most widgets', 'Some widgets' and 'Single widget'. The first two options both lead to 'App state'. The 'Single widget' option leads to 'Ephemeral state'.">
125
+
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/ephemeral-vs-app-state.png'width="100%"class="diagram-wrap"alt="A flow chart. Start with 'Data'. 'Who needs it?'. Three options: 'Most widgets', 'Some widgets' and 'Single widget'. The first two options both lead to 'App state'. The 'Single widget' option leads to 'Ephemeral state'.">
126
126
127
127
{% comment %}
128
128
Source drawing for the png above: : https://docs.google.com/drawings/d/1p5Bvuagin9DZH8bNrpGfpQQvKwLartYhIvD0WKGa64k/edit?usp=sharing
Copy file name to clipboardExpand all lines: src/content/data-and-backend/state-mgmt/simple.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ you can find packages and tutorials listed on the [options page][].
28
28
29
29
## Our example
30
30
31
-
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/model-shopper-screencast.webp'alt='An animated gif showing a Flutter app in use. It starts with the user on a login screen. They log in and are taken to the catalog screen, with a list of items. The click on several items, and as they do so, the items are marked as "added". The user clicks on a button and gets taken to the cart view. They see the items there. They go back to the catalog, and the items they bought still show "added". End of animation.'class='site-image-right'>
31
+
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/model-shopper-screencast.webp'alt='An animated gif showing a Flutter app in use. It starts with the user on a login screen. They log in and are taken to the catalog screen, with a list of items. The click on several items, and as they do so, the items are marked as "added". The user clicks on a button and gets taken to the cart view. They see the items there. They go back to the catalog, and the items they bought still show "added". End of animation.'class='site-image-right'style="max-height: 24rem;">
32
32
33
33
For illustration, consider the following simple app.
34
34
@@ -43,7 +43,7 @@ and a scrolling view of many list items (`MyListItems`).
43
43
44
44
Here's the app visualized as a widget tree.
45
45
46
-
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/simple-widget-tree.png'width="100%"alt="A widget tree with MyApp at the top, and MyCatalog and MyCart below it. MyCart area leaf nodes, but MyCatalog have two children: MyAppBar and a list of MyListItems.">
46
+
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/simple-widget-tree.png'width="100%"class="diagram-wrap"alt="A widget tree with MyApp at the top, and MyCatalog and MyCart below it. MyCart area leaf nodes, but MyCatalog have two children: MyAppBar and a list of MyListItems.">
47
47
48
48
{% comment %}
49
49
Source drawing for the png above: https://docs.google.com/drawings/d/1KXxAl_Ctxc-avhR4uE58BXBM6Tyhy0pQMCsSMFHVL_0/edit?zx=y4m1lzbhsrvx
@@ -135,7 +135,7 @@ it rebuilds `MyCart` from above (more on that later). Because of this,
135
135
what to show for any given `contents`. When that changes, the old
136
136
`MyCart` widget disappears and is completely replaced by the new one.
137
137
138
-
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/simple-widget-tree-with-cart.png'width="100%"alt="Same widget tree as above, but now we show a small 'cart' badge next to MyApp, and there are two arrows here. One comes from one of the MyListItems to the 'cart', and another one goes from the 'cart' to the MyCart widget.">
138
+
<imgsrc='/assets/images/docs/development/data-and-backend/state-mgmt/simple-widget-tree-with-cart.png'width="100%"class="diagram-wrap"alt="Same widget tree as above, but now we show a small 'cart' badge next to MyApp, and there are two arrows here. One comes from one of the MyListItems to the 'cart', and another one goes from the 'cart' to the MyCart widget.">
139
139
140
140
{% comment %}
141
141
Source drawing for the png above: https://docs.google.com/drawings/d/1ErMyaX4fwfbIW9ABuPAlHELLGMsU6cdxPDFz_elsS9k/edit?zx=j42inp8903pt
{:width="100%" .diagram-wrap}
720
716
721
717
Most Flutter widgets are rendered by an object that inherits from the
722
718
`RenderBox` subclass, which represents a `RenderObject` of fixed size in a 2D
@@ -730,8 +726,7 @@ the child _must_ respect the constraints given to it by its parent. Children
730
726
respond by **passing up a size** to their parent object within the constraints
Most of this should look as you might expect, but you might be wondering
55
55
about the containers (shown in pink). [`Container`][] is a widget class
@@ -361,11 +361,11 @@ columns inside of rows or columns.
361
361
This layout is organized as a `Row`. The row contains two children:
362
362
a column on the left, and an image on the right:
363
363
364
-
<imgsrc='/assets/images/docs/ui/layout/pavlova-diagram.png'alt="Screenshot with callouts showing the row containing two children">
364
+
<imgsrc='/assets/images/docs/ui/layout/pavlova-diagram.png'class="diagram-wrap"alt="Screenshot with callouts showing the row containing two children">
365
365
366
366
The left column's widget tree nests rows and columns.
367
367
368
-
<imgsrc='/assets/images/docs/ui/layout/pavlova-left-column-diagram.png'alt="Diagram showing a left column broken down to its sub-rows and sub-columns">
368
+
<imgsrc='/assets/images/docs/ui/layout/pavlova-left-column-diagram.png'class="diagram-wrap"alt="Diagram showing a left column broken down to its sub-rows and sub-columns">
369
369
370
370
You'll implement some of Pavlova's layout code in
371
371
[Nesting rows and columns](#nesting-rows-and-columns).
@@ -399,10 +399,10 @@ axis runs horizontally.
399
399
400
400
<divclass="side-by-side">
401
401
<divclass="centered-rows">
402
-
<img src='/assets/images/docs/ui/layout/row-diagram.png' alt="Diagram showing the main axis and cross axis for a row">
402
+
<img src='/assets/images/docs/ui/layout/row-diagram.png' class="diagram-wrap" alt="Diagram showing the main axis and cross axis for a row">
403
403
</div>
404
404
<divclass="centered-rows">
405
-
<img src='/assets/images/docs/ui/layout/column-diagram.png' alt="Diagram showing the main axis and cross axis for a column">
405
+
<img src='/assets/images/docs/ui/layout/column-diagram.png' class="diagram-wrap" alt="Diagram showing the main axis and cross axis for a column">
406
406
</div>
407
407
</div>
408
408
@@ -442,7 +442,7 @@ space evenly between, before, and after each image.
442
442
443
443
</div>
444
444
<div>
445
-
<imgsrc='/assets/images/docs/ui/layout/row-spaceevenly-visual.png'alt="Row with 3 evenly spaced images">
445
+
<imgsrc='/assets/images/docs/ui/layout/row-spaceevenly-visual.png'class="small-diagram-wrap"alt="Row with 3 evenly spaced images">
Widgets can be sized to fit within a row or column by using the
493
493
[`Expanded`][] widget. To fix the previous example where the
@@ -511,7 +511,7 @@ wrap each image with an `Expanded` widget.
511
511
512
512
</div>
513
513
<div>
514
-
<imgsrc='/assets/images/docs/ui/layout/row-expanded-2-visual.png'alt="Row of 3 images that are too wide, but each is constrained to take only 1/3 of the space">
514
+
<imgsrc='/assets/images/docs/ui/layout/row-expanded-2-visual.png'class="small-diagram-wrap"alt="Row of 3 images that are too wide, but each is constrained to take only 1/3 of the space">
@@ -540,7 +540,7 @@ the flex factor of the middle image to 2:
540
540
541
541
</div>
542
542
<div>
543
-
<imgsrc='/assets/images/docs/ui/layout/row-expanded-visual.png'alt="Row of 3 images with the middle image twice as wide as the others">
543
+
<imgsrc='/assets/images/docs/ui/layout/row-expanded-visual.png'class="small-diagram-wrap"alt="Row of 3 images with the middle image twice as wide as the others">
0 commit comments