File tree 3 files changed +17
-13
lines changed
examples/api/lib/widgets/basic
packages/flutter/lib/src/widgets 3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 7
7
"editor.formatOnSave" : false ,
8
8
"editor.formatOnType" : false ,
9
9
10
- "html.format.enable" : false
10
+ "html.format.enable" : false ,
11
+ "githubPullRequests.ignoredPullRequestBranches" : [
12
+ " master"
13
+ ]
11
14
}
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- // Flutter code sample for [FittedBox].
6
-
7
5
import 'package:flutter/material.dart' ;
8
6
7
+ /// Flutter code sample for [FittedBox] .
8
+
9
9
void main () => runApp (const FittedBoxApp ());
10
10
11
11
class FittedBoxApp extends StatelessWidget {
@@ -32,12 +32,12 @@ class FittedBoxExample extends StatelessWidget {
32
32
return Container (
33
33
height: 400 ,
34
34
width: 300 ,
35
- color: Colors .red,
36
- child: FittedBox (
35
+ color: Colors .blue,
36
+ child: const FittedBox (
37
+ // TRY THIS: Try changing the fit types to see how they change the way
38
+ // the placeholder fits into the container.
37
39
fit: BoxFit .fill,
38
- child: Image .network (
39
- 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg' ,
40
- ),
40
+ child: Placeholder (),
41
41
),
42
42
);
43
43
}
Original file line number Diff line number Diff line change @@ -1701,17 +1701,18 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
1701
1701
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
1702
1702
///
1703
1703
/// {@tool dartpad}
1704
- /// In this example, the image is stretched to fill the entire [Container] , which would
1705
- /// not happen normally without using FittedBox.
1704
+ /// In this example, the [Placeholder] is stretched to fill the entire
1705
+ /// [Container] . Try changing the fit types to see the effect on the layout of
1706
+ /// the [Placeholder] .
1706
1707
///
1707
1708
/// ** See code in examples/api/lib/widgets/basic/fitted_box.0.dart **
1708
1709
/// {@end-tool}
1709
1710
///
1710
1711
/// See also:
1711
1712
///
1712
- /// * [Transform] , which applies an arbitrary transform to its child widget at
1713
- /// paint time.
1714
- /// * The [catalog of layout widgets] (https://flutter.dev/widgets/layout/).
1713
+ /// * [Transform] , which applies an arbitrary transform to its child widget at
1714
+ /// paint time.
1715
+ /// * The [catalog of layout widgets] (https://flutter.dev/widgets/layout/).
1715
1716
class FittedBox extends SingleChildRenderObjectWidget {
1716
1717
/// Creates a widget that scales and positions its child within itself according to [fit] .
1717
1718
///
You can’t perform that action at this time.
0 commit comments