Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions docs/widgets/sliver_fill_remaining.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ To learn more about the SliverFillRemaining widget in Flutter, refer to the
> `SliverFillRemaining` is typically placed **at the end** of a `CustomScrollView`
> to ensure it fills the remaining viewport space correctly.

## Example JSON

```json
## Example

<CodeGroup>
```dart Dart
const StacSliverFillRemaining(
hasScrollBody: false,
child: StacCenter(
child: StacText(data: 'This content fills the remaining space'),
),
)
```

```json JSON
{
"type": "sliverFillRemaining",
"hasScrollBody": false,
Expand All @@ -40,4 +50,5 @@ To learn more about the SliverFillRemaining widget in Flutter, refer to the
}
}
}
```
```
</CodeGroup>
67 changes: 64 additions & 3 deletions docs/widgets/sliver_grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,69 @@ To learn more about Flutter’s `SliverGrid`, refer to the
> Each child of a `sliverGrid` must be a **box widget** (for example `container`,
> `card`, `column`, etc.), not another sliver.

## Example JSON
## Example

```json
<CodeGroup>
```dart Dart
const StacSliverGrid(
crossAxisCount: 2,
mainAxisSpacing: 16,
crossAxisSpacing: 16,
childAspectRatio: 1,
children: [
StacContainer(
color: StacColor('#4CAF50'),
child: StacCenter(
child: StacText(
data: 'Grid Item 1',
style: StacTextStyle(
color: StacColor('#FFFFFF'),
fontWeight: StacFontWeight.bold,
),
),
),
),
StacContainer(
color: StacColor('#4CAF50'),
child: StacCenter(
child: StacText(
data: 'Grid Item 2',
style: StacTextStyle(
color: StacColor('#FFFFFF'),
fontWeight: StacFontWeight.bold,
),
),
),
),
StacContainer(
color: StacColor('#4CAF50'),
child: StacCenter(
child: StacText(
data: 'Grid Item 3',
style: StacTextStyle(
color: StacColor('#FFFFFF'),
fontWeight: StacFontWeight.bold,
),
),
),
),
StacContainer(
color: StacColor('#4CAF50'),
child: StacCenter(
child: StacText(
data: 'Grid Item 4',
style: StacTextStyle(
color: StacColor('#FFFFFF'),
fontWeight: StacFontWeight.bold,
),
),
),
),
],
)
```

```json JSON
{
"type": "sliverGrid",
"crossAxisCount": 2,
Expand Down Expand Up @@ -103,4 +163,5 @@ To learn more about Flutter’s `SliverGrid`, refer to the
}
]
}
```
```
</CodeGroup>
36 changes: 33 additions & 3 deletions docs/widgets/sliver_list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,38 @@ To learn more about the SliverList widget in Flutter, refer to the
> To apply padding, opacity, or other sliver-level effects, wrap the `SliverList`
> with widgets such as `SliverPadding` or `SliverOpacity`.

## Example JSON
## Example

```json
<CodeGroup>
```dart Dart
const StacSliverList(
children: [
StacContainer(
height: 80,
color: StacColor.primary,
child: StacCenter(
child: StacText(data: 'List Item 1'),
),
),
StacContainer(
height: 80,
color: StacColor.secondary,
child: StacCenter(
child: StacText(data: 'List Item 2'),
),
),
StacContainer(
height: 80,
color: StacColor.success,
child: StacCenter(
child: StacText(data: 'List Item 3'),
),
),
],
)
```

```json JSON
{
"type": "scaffold",
"body": {
Expand Down Expand Up @@ -78,4 +107,5 @@ To learn more about the SliverList widget in Flutter, refer to the
]
}
}
```
```
</CodeGroup>