Unverified Commit 18489fdd authored by Abhishek Ghaskata's avatar Abhishek Ghaskata Committed by GitHub

Added Alignment docs for FractionallySizedBox (#82539)

parent 26c693fd
......@@ -2676,6 +2676,33 @@ class UnconstrainedBox extends StatelessWidget {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=PEsY654EGZ0}
///
/// {@tool dartpad --template=stateless_widget_scaffold}
///
/// This sample shows a [FractionallySizedBox] whose one child is 50% of
/// the box's size per the width and height factor parameters, and centered
/// within that box by the alignment parameter.
///
/// ```dart
/// Widget build(BuildContext context) {
/// return SizedBox.expand(
/// child: FractionallySizedBox(
/// widthFactor: 0.5,
/// heightFactor: 0.5,
/// alignment: FractionalOffset.center,
/// child: DecoratedBox(
/// decoration: BoxDecoration(
/// border: Border.all(
/// color: Colors.blue,
/// width: 4,
/// ),
/// ),
/// ),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [Align], which sizes itself based on its child's size and positions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment