Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
19b2aea6
Unverified
Commit
19b2aea6
authored
Oct 05, 2020
by
Justin McCandless
Committed by
GitHub
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InteractiveViewer table example improvements (#67314)
Improving IV table docs due to confusion in an issue.
parent
01e8c395
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
26 deletions
+32
-26
interactive_viewer.dart
packages/flutter/lib/src/widgets/interactive_viewer.dart
+32
-26
No files found.
packages/flutter/lib/src/widgets/interactive_viewer.dart
View file @
19b2aea6
...
@@ -107,6 +107,10 @@ class InteractiveViewer extends StatefulWidget {
...
@@ -107,6 +107,10 @@ class InteractiveViewer extends StatefulWidget {
/// single gesture begun along one axis cannot also cause panning along the
/// single gesture begun along one axis cannot also cause panning along the
/// other axis without stopping and beginning a new gesture. This is a common
/// other axis without stopping and beginning a new gesture. This is a common
/// pattern in tables where data is displayed in columns and rows.
/// pattern in tables where data is displayed in columns and rows.
///
/// See also:
/// * [constrained], which has an example of creating a table that uses
/// alignPanAxis.
final
bool
alignPanAxis
;
final
bool
alignPanAxis
;
/// A margin for the visible boundaries of the child.
/// A margin for the visible boundaries of the child.
...
@@ -146,34 +150,36 @@ class InteractiveViewer extends StatefulWidget {
...
@@ -146,34 +150,36 @@ class InteractiveViewer extends StatefulWidget {
///
///
/// ```dart
/// ```dart
/// Widget build(BuildContext context) {
/// Widget build(BuildContext context) {
/// const int _rowCount =
20
;
/// const int _rowCount =
48
;
/// const int _columnCount =
3
;
/// const int _columnCount =
6
;
///
///
/// return Scaffold(
/// return InteractiveViewer(
/// appBar: AppBar(
/// alignPanAxis: true,
/// title: const Text('Pannable Table'),
/// constrained: false,
/// ),
/// scaleEnabled: false,
/// body: InteractiveViewer(
/// child: Table(
/// constrained: false,
/// columnWidths: <int, TableColumnWidth>{
/// scaleEnabled: false,
/// for (int column = 0; column < _columnCount; column += 1)
/// child: Table(
/// column: const FixedColumnWidth(200.0),
/// columnWidths: <int, TableColumnWidth>{
/// },
/// for (int column = 0; column < _columnCount; column += 1)
/// children: <TableRow>[
/// column: const FixedColumnWidth(300.0),
/// for (int row = 0; row < _rowCount; row += 1)
/// },
/// TableRow(
/// children: <TableRow>[
/// children: <Widget>[
/// for (int row = 0; row < _rowCount; row += 1)
/// for (int column = 0; column < _columnCount; column += 1)
/// TableRow(
/// Container(
/// children: <Widget>[
/// height: 26,
/// for (int column = 0; column < _columnCount; column += 1)
/// color: row % 2 + column % 2 == 1
/// Container(
/// ? Colors.white
/// height: 100,
/// : Colors.grey.withOpacity(0.1),
/// color: row % 2 + column % 2 == 1 ? Colors.red : Colors.green,
/// child: Align(
/// alignment: Alignment.centerLeft,
/// child: Text('$row x $column'),
/// ),
/// ),
///
]
,
///
)
,
///
)
,
///
]
,
///
]
,
///
)
,
///
)
,
///
]
,
/// ),
/// ),
/// );
/// );
/// }
/// }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment