AdoptAWidget: FittedBox (#69503)

This commit is contained in:
Suryanshu Singh 2020-11-01 20:18:04 +05:30 committed by GitHub
parent 72025f0ee5
commit e9b183d47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1474,6 +1474,27 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
///
/// {@tool sample --template=stateless_widget_scaffold_center}
///
/// In this example, the image is stretched to fill the entire [Container], which would
/// not happen normally without using FittedBox.
///
/// ```dart
/// Widget build(BuildContext) {
/// return Container(
/// height: 400,
/// width: 300,
/// color: Colors.red,
/// child: FittedBox(
/// child: Image.network('https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
/// fit: BoxFit.fill,
/// ),
/// );
/// }
/// ```
///
/// {@end-tool}
///
/// See also:
///
/// * [Transform], which applies an arbitrary transform to its child widget at