GutterTheme class

A theme class that defines how gutters should be calculated based on screen width.

GutterTheme is a core configuration component in the Arcane UI system, enabling customizable responsive horizontal padding for layout widgets like Gutter and SliverGutter. It allows developers to tailor margin behaviors to app-specific design needs, such as tighter spacing for compact forms or wider margins for expansive sections. Key features include:

  • A pluggable calculation function for dynamic gutter widths
  • Toggleable enabling to disable gutters globally or per-widget
  • Integration with ArcaneTheme for theme-wide consistency

Usage: Extend or override in ArcaneTheme to apply custom gutter logic across the app, ensuring layouts remain balanced on varying screen sizes. For example, pair with Section for sectioned content or Padding for fine-tuned inner spacing.

See also:

  • doc/component/gutter.md for detailed usage examples and best practices
  • Gutter, the primary widget for non-sliver responsive padding
  • SliverGutter, the sliver counterpart for scrollable layouts

Constructors

GutterTheme({double gutterCalc(double screenWidth) = _defaultGutterCalc, bool enabled = true})
Creates a GutterTheme with the specified configuration.
const

Properties

enabled bool
Whether gutters are enabled by default.
final
gutterCalc double Function(double screenWidth)
Function that calculates the gutter width based on screen width.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({double gutterCalc(double screenWidth)?, bool? enabled}) GutterTheme
Creates a copy of this GutterTheme with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited