title: Renderbox was not laid out when added to a row
body: <p>I have looked at quite a few answers about this error, and I'm not quite sure which widgets width is the problem. I would ideally like a vertical form that can scroll, and is fairly manageable. I have the form working like I want, but as I add more fields, I will need to scroll. In preparing for this, I've also thought ahead and decided to make my label and field, a horizontal form element. Prior to adding the "field" method, I had a label widget and a textbox widget, that I put directly into the form, but I decided to wrap the two widgets into a row, to save some screen real estate. I've tried wrapping them in a sized box, as the error indicates it's an uncertainty in the size of a widget. </p>
  
  <p>Can someone help me with this? Additionally, are there any resources out there that explain how to better troubleshoot widget issues like this? And are there any resources out there discussing the issue I'm facing?</p>
  
  <p>Thanks in advance</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:wedding_app/models/constants/colors.dart';
  import 'package:wedding_app/models/constants/styles.dart';
  import 'package:wedding_app/models/constants/utility.dart';
  import 'package:intl/intl.dart';
  
  class BudgetWidget extends StatefulWidget {
    @override
    _BudgetWidgetState createState() =&gt; _BudgetWidgetState();
  }
  // limo, flowers, wedding invites, save the dates, center pieces,
  
  class _BudgetWidgetState extends State&lt;BudgetWidget&gt; {
    _BudgetWidgetState({this.totalBudget});
  
    var currencyFormat = NumberFormat.simpleCurrency();
  
    double totalBudget = 0;
    double currentExpenses = 0;
    Map&lt;String, double&gt; expenses =
        new Map.from({"venue": 0.0, "limo": 0.0, "flowers": 0.0});
  
    @override
    Widget build(BuildContext context) {
      final colors = ApplicationColors();
  
      var form = &lt;Widget&gt;[
        Padding(
          padding: EdgeInsets.only(top: BudgetingStyles.topPadding(context)),
          child: Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              Center(
                child: Text(
                  totalBudget == null || totalBudget == 0
                      ? "Your Budget"
                      : currencyFormat.format(
                          totalBudget - expenses.values.reduce((a, b) =&gt; a + b)),
                  style: TextStyle(
                      fontFamily: "acme",
                      fontSize: BudgetingStyles.headerFontSize(context),
                      color: colors.black),
                ),
              ),
            ],
          ),
        ),
        textBox(
          "Enter your budget",
          BudgetingStyles.textBoxMargins(context),
          BudgetingStyles.topPadding(context),
          (String value) {
            if (Utility.isNumeric(value)) {
              setState(() {
                totalBudget = double.parse(value);
              });
            } else if (totalBudget &gt; 0 &amp;&amp; value.length == 0) {
              setState(() {
                totalBudget = 0;
              });
            }
          },
        ),
        Padding(
          padding: EdgeInsets.only(top: BudgetingStyles.topPadding(context) * 2),
          child: Text(
            "Expenses",
            style: TextStyle(
                fontFamily: "acme",
                fontSize: BudgetingStyles.headerFontSize(context)),
          ),
        ),
        Padding(
          padding: EdgeInsets.only(top: 3),
          child: Divider(
            color: colors.black,
          ),
        ),
        field("Venue Cost", "Venue", "venue"),
        field("Limo Cost", "Limo", "limo"),
        field("Flowers Cost", "Flowers", "flowers")
      ];
  
      var innerContainer = Container(
        color: colors.ivory,
        child: Column(
          mainAxisSize: MainAxisSize.max,
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.start,
          children: form,
        ),
      );
  
      return Scaffold(
        body: innerContainer,
      );
    }
  
  // Why did wrapping it the label and field in a row, give a paint error
    Widget field(String hintText, String labelText, String expenseKey) {
      return Row(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: &lt;Widget&gt;[
          Container(
            child: Padding(
              padding: const EdgeInsets.only(top: 2.0),
              child: Text(
                labelText,
                style: TextStyle(
                    fontFamily: "acme",
                    fontSize: BudgetingStyles.subHeaderFontSize(context)),
              ),
            ),
          ),
          textBox(
            hintText,
            BudgetingStyles.textBoxMargins(context),
            BudgetingStyles.topPadding(context),
            (String value) {
              setState(
                () {
                  expenses[expenseKey] =
                      Utility.isNumeric(value) ? double.parse(value) : 0;
                },
              );
            },
          )
        ],
      );
    }
  
    Widget textBox(String hintText, double textboxPaddingWidth, double topPadding,
        void onChangeHandler(String value)) {
      return Container(
        child: Padding(
          padding: EdgeInsets.only(
              left: textboxPaddingWidth,
              right: textboxPaddingWidth,
              top: topPadding),
          child: TextField(
              textAlign: TextAlign.center,
              keyboardType: TextInputType.number,
              decoration: InputDecoration(
                hintText: hintText,
              ),
              onChanged: onChangeHandler),
        ),
      );
    }
  }
  </code></pre>
  
  <p>Here is the closest thing to a stack trace I could find</p>
  
  <pre><code>The following RenderObject was being processed when the exception was fired:
  I/flutter (16757):   RenderFlex#a932f relayoutBoundary=up3 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):   creator: Row ← Column ← DecoratedBox ← Container ← MediaQuery ← LayoutId-[&lt;_ScaffoldSlot.body&gt;] ←
  I/flutter (16757):   CustomMultiChildLayout ← AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ←
  I/flutter (16757):   _InkFeatures-[GlobalKey#bfdef ink renderer] ← NotificationListener&lt;LayoutChangedNotification&gt; ← ⋯
  I/flutter (16757):   parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)
  I/flutter (16757):   constraints: BoxConstraints(0.0&lt;=w&lt;=411.4, 0.0&lt;=h&lt;=Infinity)
  I/flutter (16757):   size: MISSING
  I/flutter (16757):   direction: horizontal
  I/flutter (16757):   mainAxisAlignment: center
  I/flutter (16757):   mainAxisSize: max
  I/flutter (16757):   crossAxisAlignment: stretch
  I/flutter (16757):   textDirection: ltr
  I/flutter (16757):   verticalDirection: down
  I/flutter (16757): This RenderObject had the following descendants (showing up to depth 5):
  I/flutter (16757):   RenderPadding#b1255 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):     RenderParagraph#411ca NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):   RenderPadding#45b3e NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):     RenderSemanticsAnnotations#4c0e1 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):       RenderIgnorePointer#2e796 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):         RenderPointerListener#d6273 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757):           _RenderDecoration#df698 NEEDS-LAYOUT NEEDS-PAINT
  I/flutter (16757): ════════════════════════════════════════════════════════════════════════════════════════════════════
  I/flutter (16757): Another exception was thrown: RenderBox was not laid out: RenderFlex#a932f relayoutBoundary=up3 NEEDS-PAINT
  I/flutter (16757): Another exception was thrown: RenderBox was not laid out: RenderFlex#edb16 relayoutBoundary=up2 NEEDS-PAINT
  I/flutter (16757): Another exception was thrown: RenderBox was not laid out: RenderDecoratedBox#ca6a1 relayoutBoundary=up1 NEEDS-PAINT
  I/flutter (16757): Another exception was thrown: RenderBox was not laid out: RenderDecoratedBox#ca6a1 relayoutBoundary=up1
  </code></pre>