title: Flutter/Dart, Switch: Another exception was thrown: A RenderFlex overflowed by 99640 pixels on the right
body: <p>I am currently trying to add a switch to the setting page of my android application. However, when I add the code and try to view it on the emulator it throws the following error:</p>
  
  <blockquote>
    <p>Another exception was thrown: A RenderFlex overflowed by 99640 pixels on the right.</p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>Container(
    decoration: BoxDecoration (
      color: Colors.white,
      border: Border(
        bottom: BorderSide(width: 1.0, color: Colors.grey)
      ),
    ),
    constraints: BoxConstraints (
      maxHeight: ((width * ratio) * 0.1),
      minWidth: width,
      maxWidth: width,
    ),
    child: Row(
      children: &lt;Widget&gt;[
        Expanded(
          child: Padding(
            padding: EdgeInsets.only(left: (width*ratio) * 0.025),
            child: Text('Highlight Identical Numbers', style: TextStyle(color: Colors.black87, fontSize: fontTextTwoScale, fontFamily: 'Roboto'))
          )
        ),
        Container(
          child: Switch(value: null, onChanged: null,)
        ),
      ],
    ),
  ),
  </code></pre>
  
  <p>I am trying to set it up so that there is text that is aligned to the left of the screen and the switch is aligned to the right. I don't understand how a widget can be 99640 pixels overflowed. I dont see a size options for the Switch. </p>
  
  <p><a href="https://i.stack.imgur.com/RRsqs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RRsqs.jpg" alt="enter image description here"></a></p>