CarpetStyle class
The core configuration class for Carpet layouts, defining tiling rules and responsive behaviors.
CarpetStyle encapsulates parameters for quilt generation, including column counts, tile dimensions, spacing, and loading thresholds. It supports computed styles via compute for context-aware adjustments and fluent builders like listView for predefined layouts. Integrates with Carpet and QuiltFaucet to produce adaptive, performant tile arrangements in the Arcane UI system, compatible with ArcaneTheme and Refresher for smooth scrolling experiences.
Constructors
- CarpetStyle({int maxSizeOptions = 10, int maxQuiltHeight = 6, int maxTileHeight = 3, int maxTileWidth = 3, double spacing = 8, int carpetWidth = 5, CarpetWidthCalculator carpetWidthCalc = _defaultCarpetWidthCalc, bool allowFutureFeeding = true, bool allowPastFeeding = true, bool includeHorizontalPadding = true, Duration loadMoreCooldown = const Duration(milliseconds: 250), int unseenQuiltTarget = 2, bool allowScalarTiles = true, bool allowHoles = false, int minTileWidth = 1, int minTileHeight = 1, double unknownExtentOfScreenMultiplier = 1.0})
-
Constructs a CarpetStyle with customizable tiling parameters.
const
Properties
- allowFutureFeeding → bool
-
final
- allowHoles → bool
-
final
- allowPastFeeding → bool
-
final
- allowScalarTiles → bool
-
final
- carpetWidth → int
-
final
- carpetWidthCalc → CarpetWidthCalculator
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- includeHorizontalPadding → bool
-
final
- loadMoreCooldown → Duration
-
final
- maxQuiltHeight → int
-
final
- maxSizeOptions → int
-
final
- maxTileHeight → int
-
final
- maxTileWidth → int
-
final
- minTileHeight → int
-
final
- minTileWidth → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
final
- unknownExtentOfScreenMultiplier → double
-
final
- unseenQuiltTarget → int
-
final
Methods
-
cellView(
{int width = 3, int height = 1, int columns = 3}) → CarpetStyle - Configures a cell-view style for uniform block layouts.
-
compute(
BuildContext context) → CarpetStyle - Computes and validates style parameters based on the current context.
-
copyWith(
{bool? allowHoles, int? maxQuiltHeight, int? maxSizeOptions, int? maxTileHeight, int? maxTileWidth, int carpetWidthCalc(BuildContext)?, int? carpetWidth, double? spacing, bool? allowFutureFeeding, bool? allowPastFeeding, bool? includeHorizontalPadding, Duration? loadMoreCooldown, int? unseenQuiltTarget, bool? allowScalarTiles, int? minTileWidth, int? minTileHeight, double? unknownExtentOfScreenMultiplier}) → CarpetStyle - Creates a copy of this CarpetStyle with optional overrides.
-
gridView(
{int width = 1, int height = 1, int tileSize = 250, int quiltHeightMultiplier = 1}) → CarpetStyle - Configures a grid-view style for multi-cell uniform layouts.
-
listView(
{int aspect = 5, int quiltHeightMultiplier = 1}) → CarpetStyle - Configures a list-view style with fixed aspect ratios.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
tapeView(
{int granularity = 20, int height = 4, int quiltMultiplier = 4, int minGranularityWidth = 5}) → CarpetStyle - Configures a tape-view style for granular, horizontal feeds.
-
targetCellSize(
int cellSize) → CarpetStyle - Creates a style targeting a specific cell size for mosaic layouts.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override