File tree Expand file tree Collapse file tree 7 files changed +51
-3
lines changed
packages/flame/lib/src/experimental Expand file tree Collapse file tree 7 files changed +51
-3
lines changed Original file line number Diff line number Diff line change 1+ # ExpandedComponent
2+
3+ ``` {dartdoc}
4+ :package: flame
5+ :symbol: ExpandedComponent
6+ :file: src/experimental/expanded_component.dart
7+ ```
Original file line number Diff line number Diff line change 11# Layout
22
33- [ Align Component] ( align_component.md )
4+ - [ Row Component] ( row_component.md )
5+ - [ Column Component] ( column_component.md )
6+ - [ Expanded Component] ( expanded_component.md )
7+ - [ Padding Component] ( padding_component.md )
48
59``` {toctree}
610:hidden:
711
8- AlignComponent <align_component.md>
12+ AlignComponent <align_component.md>
13+ RowComponent <row_component.md>
14+ ColumnComponent <column_component.md>
15+ Expanded Component <expanded_component.md>
16+ Padding Component <padding_component.md>
917```
Original file line number Diff line number Diff line change 1+ # PaddingComponent
2+
3+ ``` {dartdoc}
4+ :package: flame
5+ :symbol: PaddingComponent
6+ :file: src/experimental/padding_component.dart
7+ ```
Original file line number Diff line number Diff line change 11import 'package:flame/src/experimental/linear_layout_component.dart' ;
22import 'package:flutter/rendering.dart' ;
33
4+ /// Warning: Experimental. API and behavior may change.
5+ ///
46/// ColumnComponent is a layout component that arranges its children in a
57/// vertical column.
68///
@@ -13,7 +15,7 @@ import 'package:flutter/rendering.dart';
1315/// If [size] is non-null, behaves as normal explicit sizing.
1416/// If [size] is null, sets the size to the minimum size that containing all
1517/// the children. This is similar to setting the [size] to [intrinsicSize] , but
16- /// the distinct in that sizing will respond to changes in children, other
18+ /// distinct in that sizing will respond to changes in children, other
1719/// properties, etc...
1820///
1921/// Example usage:
Original file line number Diff line number Diff line change 11import 'package:flame/components.dart' ;
22import 'package:flame/experimental.dart' ;
33
4+ /// Warning: Experimental. API and behavior may change.
5+ ///
46/// Works similarly to flutter's Expanded widget.
57/// This component must be a direct child of a [LinearLayoutComponent] .
68/// While this component does not do much on its own, it allows its parent
@@ -17,6 +19,18 @@ import 'package:flame/experimental.dart';
1719/// However, it does need to report to its parent when its child changes size.
1820/// This is less important along the main-axis, and more important along the
1921/// cross-axis.
22+ ///
23+ /// Example usage:
24+ /// ```dart
25+ /// ColumnComponent(
26+ /// children: [
27+ /// ExpandedComponent(
28+ /// child: TextComponent(text: 'foo'),
29+ /// );
30+ /// TextComponent(text: 'bar')
31+ /// ],
32+ /// );
33+ /// ```
2034class ExpandedComponent extends SingleLayoutComponent
2135 with ParentIsA <LinearLayoutComponent > {
2236 ExpandedComponent ({
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ import 'package:flutter/rendering.dart';
1515///
1616/// You may set [padding] as well as the [child] after the fact, and it will
1717/// cause the layout to refresh.
18+ ///
19+ /// Example usage:
20+ /// ```dart
21+ /// PaddingComponent(
22+ /// padding: EdgeInsets.all(10),
23+ /// child: TextComponent(text: 'bar')
24+ /// );
25+ /// ```
1826class PaddingComponent extends SingleLayoutComponent {
1927 PaddingComponent ({
2028 super .key,
Original file line number Diff line number Diff line change 11import 'package:flame/src/experimental/linear_layout_component.dart' ;
22import 'package:flutter/rendering.dart' ;
33
4+ /// Warning: Experimental. API and behavior may change.
5+ ///
46/// RowComponent is a layout component that arranges its children in a
57/// horizontal row.
68///
@@ -13,7 +15,7 @@ import 'package:flutter/rendering.dart';
1315/// If [size] is non-null, behaves as normal explicit sizing.
1416/// If [size] is null, sets the size to the minimum size that containing all
1517/// the children. This is similar to setting the [size] to [intrinsicSize] , but
16- /// the distinct in that sizing will respond to changes in children, other
18+ /// distinct in that sizing will respond to changes in children, other
1719/// properties, etc...
1820///
1921/// Example usage:
You can’t perform that action at this time.
0 commit comments