BoxFit documentation (#10397)
This commit is contained in:
parent
2ab60e93ef
commit
c713aa0020
@ -13,33 +13,68 @@ import 'basic_types.dart';
|
|||||||
///
|
///
|
||||||
/// See also [applyBoxFit], which applies the sizing semantics of these values
|
/// See also [applyBoxFit], which applies the sizing semantics of these values
|
||||||
/// (though not the alignment semantics).
|
/// (though not the alignment semantics).
|
||||||
|
///
|
||||||
|
/// The following diagrams show the effects of each value:
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// 
|
||||||
enum BoxFit {
|
enum BoxFit {
|
||||||
/// Fill the target box by distorting the source's aspect ratio.
|
/// Fill the target box by distorting the source's aspect ratio.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
fill,
|
fill,
|
||||||
|
|
||||||
/// As large as possible while still containing the source entirely within the
|
/// As large as possible while still containing the source entirely within the
|
||||||
/// target box.
|
/// target box.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
contain,
|
contain,
|
||||||
|
|
||||||
/// As small as possible while still covering the entire target box.
|
/// As small as possible while still covering the entire target box.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
cover,
|
cover,
|
||||||
|
|
||||||
/// Make sure the full width of the source is shown, regardless of
|
/// Make sure the full width of the source is shown, regardless of
|
||||||
/// whether this means the source overflows the target box vertically.
|
/// whether this means the source overflows the target box vertically.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
fitWidth,
|
fitWidth,
|
||||||
|
|
||||||
/// Make sure the full height of the source is shown, regardless of
|
/// Make sure the full height of the source is shown, regardless of
|
||||||
/// whether this means the source overflows the target box horizontally.
|
/// whether this means the source overflows the target box horizontally.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
fitHeight,
|
fitHeight,
|
||||||
|
|
||||||
/// Align the source within the target box (by default, centering) and discard
|
/// Align the source within the target box (by default, centering) and discard
|
||||||
/// any portions of the source that lie outside the box.
|
/// any portions of the source that lie outside the box.
|
||||||
|
///
|
||||||
|
/// The source image is not resized.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
none,
|
none,
|
||||||
|
|
||||||
/// Align the source within the target box (by default, centering) and, if
|
/// Align the source within the target box (by default, centering) and, if
|
||||||
/// necessary, scale the source down to ensure that the source fits within the
|
/// necessary, scale the source down to ensure that the source fits within the
|
||||||
/// box.
|
/// box.
|
||||||
scaleDown
|
///
|
||||||
|
/// This is the same as `contain` if that would shrink the image, otherwise it
|
||||||
|
/// is the same as `none`.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
scaleDown,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The pair of sizes returned by [applyBoxFit].
|
/// The pair of sizes returned by [applyBoxFit].
|
||||||
@ -56,7 +91,7 @@ class FittedSizes {
|
|||||||
final Size destination;
|
final Size destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply an [BoxFit] value.
|
/// Apply a [BoxFit] value.
|
||||||
///
|
///
|
||||||
/// The arguments to this method, in addition to the [BoxFit] value to apply,
|
/// The arguments to this method, in addition to the [BoxFit] value to apply,
|
||||||
/// are two sizes, ostensibly the sizes of an input box and an output box.
|
/// are two sizes, ostensibly the sizes of an input box and an output box.
|
||||||
|
@ -330,7 +330,7 @@ class BorderSide {
|
|||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// // All four borders the same, two-pixel wide solid white:
|
/// // All four borders the same, two-pixel wide solid white:
|
||||||
/// const Border.all(width: 2.0, color: const Color(0xFFFFFFFF))
|
/// new Border.all(width: 2.0, color: const Color(0xFFFFFFFF))
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user