mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
* Added Dartpad sample for Table widget * Changed template to stateless_widget_scaffold * Removed trailing character
This commit is contained in:
parent
a82c786d29
commit
3b7718c27d
|
@ -81,6 +81,70 @@ class _TableElementRow {
|
|||
///
|
||||
/// {@youtube 560 315 https://www.youtube.com/watch?v=_lbE0wsVZSw}
|
||||
///
|
||||
/// {@tool dartpad --template=stateless_widget_scaffold}
|
||||
///
|
||||
/// This sample shows a `Table` with borders, multiple types of column widths and different vertical cell alignments.
|
||||
///
|
||||
/// ```dart
|
||||
/// Widget build(BuildContext context) {
|
||||
/// return Table(
|
||||
/// border: TableBorder.all(),
|
||||
/// columnWidths: {
|
||||
/// 0: IntrinsicColumnWidth(),
|
||||
/// 1: FlexColumnWidth(),
|
||||
/// 2: FixedColumnWidth(64),
|
||||
/// },
|
||||
/// defaultVerticalAlignment: TableCellVerticalAlignment.middle,
|
||||
/// children: [
|
||||
/// TableRow(
|
||||
/// children: [
|
||||
/// Container(
|
||||
/// height: 32,
|
||||
/// color: Colors.green,
|
||||
/// ),
|
||||
/// TableCell(
|
||||
/// verticalAlignment: TableCellVerticalAlignment.top,
|
||||
/// child: Container(
|
||||
/// height: 32,
|
||||
/// width: 32,
|
||||
/// color: Colors.red,
|
||||
/// ),
|
||||
/// ),
|
||||
/// Container(
|
||||
/// height: 64,
|
||||
/// color: Colors.blue,
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// TableRow(
|
||||
/// decoration: BoxDecoration(
|
||||
/// color: Colors.grey,
|
||||
/// ),
|
||||
/// children: [
|
||||
/// Container(
|
||||
/// height: 64,
|
||||
/// width: 128,
|
||||
/// color: Colors.purple,
|
||||
/// ),
|
||||
/// Container(
|
||||
/// height: 32,
|
||||
/// color: Colors.yellow,
|
||||
/// ),
|
||||
/// Center(
|
||||
/// child: Container(
|
||||
/// height: 32,
|
||||
/// width: 32,
|
||||
/// color: Colors.orange,
|
||||
/// ),
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// ],
|
||||
/// );
|
||||
/// }
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// If you only have one row, the [Row] widget is more appropriate. If you only
|
||||
/// have one column, the [SliverList] or [Column] widgets will be more
|
||||
/// appropriate.
|
||||
|
|
Loading…
Reference in a new issue