Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c26d1de4
Unverified
Commit
c26d1de4
authored
Mar 30, 2023
by
Greg Spencer
Committed by
GitHub
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the networked image from the example (#123728)
parent
f266cccd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
settings.json
.vscode/settings.json
+4
-1
fitted_box.0.dart
examples/api/lib/widgets/basic/fitted_box.0.dart
+7
-7
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+6
-5
No files found.
.vscode/settings.json
View file @
c26d1de4
...
@@ -7,5 +7,8 @@
...
@@ -7,5 +7,8 @@
"editor.formatOnSave"
:
false
,
"editor.formatOnSave"
:
false
,
"editor.formatOnType"
:
false
,
"editor.formatOnType"
:
false
,
"html.format.enable"
:
false
"html.format.enable"
:
false
,
"githubPullRequests.ignoredPullRequestBranches"
:
[
"master"
]
}
}
\ No newline at end of file
examples/api/lib/widgets/basic/fitted_box.0.dart
View file @
c26d1de4
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// Flutter code sample for [FittedBox].
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
/// Flutter code sample for [FittedBox].
void
main
(
)
=>
runApp
(
const
FittedBoxApp
());
void
main
(
)
=>
runApp
(
const
FittedBoxApp
());
class
FittedBoxApp
extends
StatelessWidget
{
class
FittedBoxApp
extends
StatelessWidget
{
...
@@ -32,12 +32,12 @@ class FittedBoxExample extends StatelessWidget {
...
@@ -32,12 +32,12 @@ class FittedBoxExample extends StatelessWidget {
return
Container
(
return
Container
(
height:
400
,
height:
400
,
width:
300
,
width:
300
,
color:
Colors
.
red
,
color:
Colors
.
blue
,
child:
FittedBox
(
child:
const
FittedBox
(
// TRY THIS: Try changing the fit types to see how they change the way
// the placeholder fits into the container.
fit:
BoxFit
.
fill
,
fit:
BoxFit
.
fill
,
child:
Image
.
network
(
child:
Placeholder
(),
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'
,
),
),
),
);
);
}
}
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
c26d1de4
...
@@ -1701,17 +1701,18 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
...
@@ -1701,17 +1701,18 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
///
///
/// {@tool dartpad}
/// {@tool dartpad}
/// In this example, the image is stretched to fill the entire [Container], which would
/// In this example, the [Placeholder] is stretched to fill the entire
/// not happen normally without using FittedBox.
/// [Container]. Try changing the fit types to see the effect on the layout of
/// the [Placeholder].
///
///
/// ** See code in examples/api/lib/widgets/basic/fitted_box.0.dart **
/// ** See code in examples/api/lib/widgets/basic/fitted_box.0.dart **
/// {@end-tool}
/// {@end-tool}
///
///
/// See also:
/// See also:
///
///
///
* [Transform], which applies an arbitrary transform to its child widget at
/// * [Transform], which applies an arbitrary transform to its child widget at
///
paint time.
/// paint time.
///
* The [catalog of layout widgets](https://flutter.dev/widgets/layout/).
/// * The [catalog of layout widgets](https://flutter.dev/widgets/layout/).
class
FittedBox
extends
SingleChildRenderObjectWidget
{
class
FittedBox
extends
SingleChildRenderObjectWidget
{
/// Creates a widget that scales and positions its child within itself according to [fit].
/// Creates a widget that scales and positions its child within itself according to [fit].
///
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment