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.
- Host: GitHub
- URL: https://github.com/wasabeef/compose-gap
- Owner: wasabeef
- License: apache-2.0
- Created: 2021-10-12T07:19:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T22:56:44.000Z (over 1 year ago)
- Last Synced: 2024-10-11T08:10:42.136Z (over 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 736 KB
- Stars: 37
- Watchers: 3
- Forks: 3
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.