---
title: Migration to 0.2.0
description: Breaking changes and migration guide for home_widget_generator 0.2.0
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.page/abausg/home_widget/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration to 0.2.0

Regenerate your widgets, then check the changes below.

## HWFill was replaced by HWSizedBox.expand

`HWFill` is gone. [`HWSizedBox`](/generator/widgets/hw-sized-box) does the same and more — a fixed width or height, and a gap without a child:

```dart
HWFill(child: x) // [!code --]
HWSizedBox.expand(child: x) // [!code ++]
```

Inside an `HWColumn` or `HWRow` an expanded box now shares the main axis by weight with its siblings on Android, where `HWFill` took all the remaining room and left them none.

On iOS `HWFill` centered a child smaller than itself. `HWSizedBox.expand` places it where its own alignment would instead — an `HWColumn` / `HWRow` by its `crossAxisAlignment`, an `HWImage` or `HWIcon` centered, a lone `HWText` at the top start — which is what the same tree already renders as on Android. A widget that relied on `HWFill` centering a bare child should wrap it in an `HWColumn` / `HWRow` with center alignments.

## Row and Column Spacing (iOS)

`HWColumn` and `HWRow` used to generate a `VStack` / `HStack` with no `spacing` and plain `Spacer()`s, so SwiftUI put a gap of its own (about 8pt) between the children and kept a minimum gap around the spacers of `mainAxisAlignment`. Android had neither. iOS stacks now leave both out:

```swift
VStack(alignment: .leading) { // [!code --]
VStack(alignment: .leading, spacing: 0) { // [!code ++]
    Text("Hello")
    Spacer() // [!code --]
    Spacer(minLength: 0) // [!code ++]
    Text("World")
}
```

Every iOS stack with two or more children gets tighter, `spaceBetween` and `spaceEvenly` layouts included. To keep a gap, set [`spacing`](/generator/widgets/hw-column#spacing). It applies on both platforms, so Android gains the same gap:

```dart
HWColumn(
  spacing: 8, // [!code ++]
  children: [...],
)
```

## A Single Child Under `spaceBetween` (iOS)

`spaceBetween` spreads the children with spacers between them, and a single child has none. Android stretched such a row or column across its main axis anyway, while iOS let it hug its child. iOS now stretches it too, with the child at the start, as Flutter does. To keep the stack hugging its child, drop the alignment:

```dart
HWRow(
  mainAxisAlignment: HWMainAxisAlignment.spaceBetween, // [!code --]
  children: [HWText(HWString('title'))],
)
```

## More Than 10 Children (Android)

Glance lays out at most 10 children in a `Column` or `Row`, and used to drop the rest without a word. A stack Android would render with more now fails generation, counting the spacers its `mainAxisAlignment` adds:

```
Widget "Stats": an HWRow has 5 children + 6 spacers (spaceEvenly) = 11 > 10. On Android, Glance lays out at most 10 children in a Row, spacers included, and silently drops the rest. Group some children in a nested HWColumn, HWRow or HWStack, which counts as one child, or use a mainAxisAlignment that adds fewer spacers.
```

To fix it, nest some children in another `HWColumn`, `HWRow` or `HWStack`, which counts as one child, or pick an alignment that adds fewer spacers:

```dart
HWRow(
  mainAxisAlignment: HWMainAxisAlignment.spaceEvenly, // [!code --]
  mainAxisAlignment: HWMainAxisAlignment.spaceBetween, // [!code ++]
  children: [...],
)
```

[Alignment](/generator/styling/hw-alignment#spacers-and-the-android-child-limit) lists how many spacers each alignment adds.

## Size-Adaptive Previews (Android)

A widget with an `HWSizeAdaptive` now declares `previewSizeMode` alongside `sizeMode`, so the widget picker shows the layout for the span it displays instead of always the smallest one. Its preview fingerprint changes, so the app re-registers that preview once after the update. No annotation change is needed.

`HWSize.fromCells` is gone; write the `const` `HWSize.cells` instead:

```dart
androidSizes: {HWWidgetFamily.systemMedium: HWSize.fromCells(3, 2)} // [!code --]
androidSizes: {HWWidgetFamily.systemMedium: HWSize.cells(3, 2)} // [!code ++]
```
