kiss_layout 3.0.0 copy "kiss_layout: ^3.0.0" to clipboard
kiss_layout: ^3.0.0 copied to clipboard

A simple system for standardizing layout in flutter

3.0.0 #

Breaking Changes #

  • BREAKING: Layout is now a StatelessWidget (previously InheritedWidget). Internal scope is provided via a private InheritedWidget.
  • BREAKING: Layout.of(context) now returns LayoutData (previously returned Layout). Access fields directly: Layout.of(context).itemSpacing instead of Layout.of(context).itemSpacing via convenience getter.
  • BREAKING: Removed convenience getters on Layout (itemSpacing, edgeSpacing, cornerRadii, heroSizes, iconSizes, actionSizes, screenSizes, modalBottomSheetHeightPercentage). Use the returned LayoutData directly.
  • BREAKING: Removed Layout.custom constructor. Pass data: to the default constructor instead.
  • BREAKING: insertSpaceBetween is now a static method on Layout.
  • BREAKING: Removed LayoutScreenBreakpoints class and LayoutData.screenSizes field. Replaced by a flexible breakpoints list on Layout using LayoutBreakpoint(minWidth, data).

Added #

  • Responsive Layout via optional breakpoints parameter — supply a list of LayoutBreakpoint entries and the active LayoutData is selected at lookup time based on the current screen width.
  • Runtime assertion that breakpoints are sorted by ascending minWidth.

Migration Guide #

// Before
Layout(
  data: LayoutData.standard.copyWith(
    screenSizes: const LayoutScreenBreakpoints(
      mediumStartPoint: 600,
      largeStartPoint: 960,
    ),
  ),
  child: child,
);
final layout = Layout.of(context);
final spacing = layout.itemSpacing;

// After
Layout(
  data: LayoutData.standard,
  breakpoints: const [
    LayoutBreakpoint(minWidth: 600, data: LayoutData.standard),
    LayoutBreakpoint(minWidth: 960, data: LayoutData.large),
  ],
  child: child,
);
final data = Layout.of(context);
final spacing = data.itemSpacing;

2.0.0 #

Breaking Changes #

  • BREAKING: Renamed LayoutScreenSizes to LayoutScreenBreakpoints
  • BREAKING: Removed minLanscapeTableWidth property (had typo in name)
  • BREAKING: Changed to T-shirt size naming with two breakpoints:
    • mediumStartPoint (default: 600) - where medium screens start
    • largeStartPoint (default: 960) - where large screens start

Added #

  • Opinionated breakpoint system with three screen sizes:
    • Small: width < 600
    • Medium: 600 ≤ width < 960
    • Large: width ≥ 960

Migration Guide #

Replace LayoutScreenSizes with LayoutScreenBreakpoints:

// Before
screenSizes: LayoutScreenSizes(minLanscapeTableWidth: 800)

// After
screenSizes: LayoutScreenBreakpoints(
  mediumStartPoint: 600,
  largeStartPoint: 960,
)

Access breakpoints using the new property names:

final breakpoints = Layout.of(context).screenSizes;
if (width < breakpoints.mediumStartPoint) {
  // Small screen
} else if (width < breakpoints.largeStartPoint) {
  // Medium screen
} else {
  // Large screen
}

1.3.1 #

Changed #

  • Updated README with documentation for selective padding factory constructors

1.3.0 #

Added #

  • Convenience factory constructors for all padding widgets to enable selective padding application:
    • onlyVertical - applies padding only to top and bottom
    • onlyHorizontal - applies padding only to left and right
    • onlyBottom - applies padding only to bottom
    • onlyTop - applies padding only to top
    • onlyLeft - applies padding only to left
    • onlyRight - applies padding only to right
    • onlyHorizontalAndBottom - applies padding to left, right, and bottom
    • onlyHorizontalAndTop - applies padding to left, right, and top
  • Available for all padding widgets: PaddingInnerSmall, PaddingInnerMedium, PaddingInnerLarge, PaddingOuterSmall, PaddingOuterMedium, PaddingOuterLarge

1.2.0 #

  • BREAKING: Refactored Layout widget to use a single LayoutData parameter instead of individual properties
    • All layout configuration is now encapsulated in the LayoutData class
    • Added predefined layouts: LayoutData.standard, LayoutData.compact, and LayoutData.spacious
    • Existing code using individual properties will need to be updated to use LayoutData

1.1.0 #

Added #

  • LayoutIconSizes for standardized icon dimensions (24×24, 16×16, 12×12)
  • Pre-built icon widgets: IconLarge, IconMedium, and IconSmall for easy access to consistent icon sizes

Changed #

  • Fixed all linter warnings by disabling public_member_api_docs rule
  • Applied dart fix to remove redundant argument values
  • Converted unnecessary double literals to integers
  • Sorted dependencies alphabetically in pubspec.yaml

1.0.0 #

All notable changes to the Kiss Layout package will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Added #

  • Initial release of Kiss Layout package
  • Core Layout widget with InheritedWidget implementation
  • T-Shirt size system (S, M, L) for consistent spacing
  • Layout configuration options:
    • LayoutItemGaps for spacing between elements
    • LayoutEdgeSpacing for outer and inner padding
    • LayoutActionSizes for standardized button dimensions
    • LayoutCornerRadii for consistent corner rounding
    • LayoutHeroSizes for featured element dimensions
    • LayoutScreenSizes for responsive breakpoints
  • Pre-built gap widgets:
    • GapSmall
    • GapMedium
    • GapLarge
  • Padding widgets with inner/outer variants:
    • PaddingInnerSmall
    • PaddingInnerMedium
    • PaddingInnerLarge
    • PaddingOuterSmall
    • PaddingOuterMedium
    • PaddingOuterLarge
  • EdgeInsets convenience extensions for directional padding
  • Global layout configuration support
  • Layout override capability for specific sections
  • Modal bottom sheet height configuration

Documentation #

  • Full README with usage examples
  • Inline code documentation
  • Example implementations of custom layouts (CompactLayout, SpaciousLayout)
5
likes
140
points
411
downloads

Documentation

API reference

Publisher

verified publisherwearemobilefirst.com

Weekly Downloads

A simple system for standardizing layout in flutter

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, gap

More

Packages that depend on kiss_layout