wasabeef / compose-gap

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compose Gap

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

Inspired by Flutter's 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

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.

  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.

About

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

License:Apache License 2.0


Languages

Language:Kotlin 87.2%Language:Shell 12.8%