constrained_scrollable_views 1.0.0 constrained_scrollable_views: ^1.0.0 copied to clipboard
Set of useful scrollable views that includes ConstrainedScrollView, ScrollableColumn, and ScrollableRow.
Constrained Scrollable Views #
Set of useful scrollable views that includes ConstrainedScrollView
, ScrollableColumn
, and ScrollableRow
.
Usage #
Usage of scrollable views is very simple: ConstrainedScrollView
is combination of SingleChildScrollView
and LayoutBuilder
; ScrollableColumn
and ScrollableRow
- Column
and Row
wrapped by ConstrainedScrollView
.
Example of using ConstrainedScrollView
:
ConstrainedScrollView(
padding: const EdgeInsets.all(8),
physics: const BouncingScrollPhysics(),
constraintsBuilder: (constraints) => BoxConstraints(
minWidth: constraints.maxWidth,
minHeight: constraints.maxHeight,
),
child: const Center(
child: Text('ScrollView value'),
),
)
Example of using ScrollableColumn
:
ScrollableColumn(
padding: const EdgeInsets.all(8),
physics: const BouncingScrollPhysics(),
constraintsBuilder: (constraints) => BoxConstraints(
minHeight: constraints.maxHeight,
),
children: [
for (var i = 0; i <= 100; i++)
Padding(
padding: const EdgeInsets.all(4),
child: Text('Column value: $i'),
),
],
)
Example of using ScrollableRow
:
ScrollableRow(
padding: const EdgeInsets.all(8),
physics: const BouncingScrollPhysics(),
constraintsBuilder: (constraints) => BoxConstraints(
minWidth: constraints.maxWidth,
),
children: [
for (var i = 0; i <= 100; i++)
Padding(
padding: const EdgeInsets.all(4),
child: Text('Row value: $i'),
),
],
)