title: Equal Width & height in Jetpack compose Box
body: <p>So I am trying to create a Chess Board using JetPack compose &amp; have managed to draw the layout a bit. But, Now I have issue that I want the board square to have a equal height as width. I want it to be perfect square.</p>
  <p><strong>Note:</strong> I don't want to give any fix width or height. I want to fit squares in the screens width &amp; then each squares' height should be as much as the width.</p>
  <p>What I have tried:</p>
  <pre><code>@ExperimentalFoundationApi
  class PlayGameActivity : BaseActivity() {
      val darkSquare = Color(0xFF779556)
      val lightSquare = Color(0xFFEBECD0)
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContent {
              Column {
                  Board()
              }
          }
      }
  
      @Composable
      fun Board() {
          Column {
              for (i in 0 until 8) {
                  Row {
                      for (j in 0 until 8) {
                          val isLightSquare = i % 2 == j % 2
                          val squareColor = if (isLightSquare) lightSquare else darkSquare
                          Box(
                              modifier = Modifier
                                  .weight(1f)
                                  .background(squareColor)
                          ) {
                              Text(text = &quot;${i + j}&quot;)
                          }
                      }
                  }
              }
          }
      }
  
  }
  </code></pre>
  <p>It gives me following result.</p>
  <p><a href="https://i.stack.imgur.com/QyhMDm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QyhMDm.png" alt="Chess Box Layout" /></a></p>
  <p>What I expect it to look like:</p>
  <p><a href="https://i.stack.imgur.com/K47k6.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/K47k6.gif" alt="Chess Box Expectations" /></a></p>
  <p>Any Idea how I can calculate width &amp; set it same as width of the square?</p>