An open API service indexing awesome lists of open source software.

https://github.com/wasabeef/compose-gap

Easily adding gaps inside such as Columns and Rows for Jetpack Compose.
https://github.com/wasabeef/compose-gap

Last synced: 10 months ago
JSON representation

Easily adding gaps inside such as Columns and Rows for Jetpack Compose.

Awesome Lists containing this project

README

          

# Compose Gap











Easily adding gaps inside such as Columns and Rows for Jetpack Compose.

Inspired by [Flutter's Gap](https://pub.dev/packages/gap).

## Introduction
When it comes to add empty space between widgets inside a Column or a Row, we have multiple options:

We can either add a Padding around these widgets but it's very verbose
Or we can add Spacer widgets between them.
Gap is another option. It's like Spacer but you don't have to know if it's inside a Row or a Column. So that it's less verbose than using a Spacer.

## Features

Gradle settings
```groovy
implementation 'jp.wasabeef:gap:1.1.0'
```

Then you just have to add a `Gap` inside a `Column` or a `Row` with the specified extent.
```kotlin
Column {
Text(text = "Hello")
// Spacer(modifier = modifier.width(20.dp))
Gap(20.dp)
Text(text = "World")
}

Row {
Text(text = "Hello")
// Spacer(modifier = modifier.height(20.dp))
Gap(20.dp)
Text(text = "World")
}
```

## Contributing

Feel free to open a issue or submit a pull request for any bugs/improvements.