AdaptiveExplorer<T> constructor
const
AdaptiveExplorer<T> ({
- Key? key,
- required List<
T> results, - required Widget filters,
- required String filtersTitle,
- required Widget itemBuilder(
- BuildContext context,
- T result,
- bool selected,
- VoidCallback onTap,
- required Widget detailBuilder(
- BuildContext context,
- T result
- String? filtersDescription,
- Widget? filtersLeading,
- List<
Widget> activeFilters = const [], - String activeFiltersLabel = 'Active filters',
- Widget? header,
- Widget? emptyState,
- AdaptiveSize dockedAt = AdaptiveSize.expanded,
- AdaptiveHeight minimumDockedHeight = AdaptiveHeight.medium,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- int? selectedIndex,
- int initialIndex = 0,
- ValueChanged<
int> ? onSelectedIndexChanged, - String modalFilterLabel = 'Open filters',
- Widget modalFilterIcon = const Icon(Icons.tune_outlined),
- double spacing = 16,
- int filtersFlex = 2,
- int resultsFlex = 2,
- int detailFlex = 3,
- double itemSpacing = 12,
- EdgeInsetsGeometry filtersPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry resultsPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry detailPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry activeFiltersPadding = const EdgeInsets.all(12),
- double modalHeightFactor = 0.72,
- bool showModalDragHandle = true,
- bool animateSize = true,
- Duration animationDuration = const Duration(milliseconds: 250),
- Curve animationCurve = Curves.easeInOutCubic,
Creates an adaptive explorer.
Implementation
const AdaptiveExplorer({
super.key,
required this.results,
required this.filters,
required this.filtersTitle,
required this.itemBuilder,
required this.detailBuilder,
this.filtersDescription,
this.filtersLeading,
this.activeFilters = const [],
this.activeFiltersLabel = 'Active filters',
this.header,
this.emptyState,
this.dockedAt = AdaptiveSize.expanded,
this.minimumDockedHeight = AdaptiveHeight.medium,
this.useContainerConstraints = true,
this.considerOrientation = false,
this.selectedIndex,
this.initialIndex = 0,
this.onSelectedIndexChanged,
this.modalFilterLabel = 'Open filters',
this.modalFilterIcon = const Icon(Icons.tune_outlined),
this.spacing = 16,
this.filtersFlex = 2,
this.resultsFlex = 2,
this.detailFlex = 3,
this.itemSpacing = 12,
this.filtersPadding = const EdgeInsets.all(16),
this.resultsPadding = const EdgeInsets.all(16),
this.detailPadding = const EdgeInsets.all(16),
this.activeFiltersPadding = const EdgeInsets.all(12),
this.modalHeightFactor = 0.72,
this.showModalDragHandle = true,
this.animateSize = true,
this.animationDuration = const Duration(milliseconds: 250),
this.animationCurve = Curves.easeInOutCubic,
}) : assert(filtersFlex > 0, 'filtersFlex must be greater than zero.'),
assert(resultsFlex > 0, 'resultsFlex must be greater than zero.'),
assert(detailFlex > 0, 'detailFlex must be greater than zero.'),
assert(spacing >= 0, 'spacing must be zero or greater.'),
assert(itemSpacing >= 0, 'itemSpacing must be zero or greater.'),
assert(
modalHeightFactor > 0 && modalHeightFactor <= 1,
'modalHeightFactor must be between 0 and 1.',
);