0

To fix the Bottom Overflow error, I'm trying to make use of the SingleChildScrollView widget. I'm tried wrapping it to the Column, as well as Scaffold but getting lot for errors.

Below is the error causing code:


class SignUp extends StatefulWidget {

  @override
  _SignUpState createState() => _SignUpState();
}

class _SignUpState extends State<SignUp> {
  final formKey = GlobalKey<FormState>();

  final TextEditingController nameController = TextEditingController();
  final TextEditingController emailController = TextEditingController();
  final TextEditingController passwordController = TextEditingController();

  final nameNode = FocusNode();
  final emailNode = FocusNode();
  final passwordNode = FocusNode();

  bool isLoading = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    nameController.dispose();
    emailController.dispose();
    passwordController.dispose();
    nameNode.dispose();
    emailNode.dispose();
    passwordNode.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    final isKeyboard = MediaQuery.of(context).viewInsets.bottom != 0;

    final appBar = AppBar(
      iconTheme: Theme.of(context).iconTheme,
      backgroundColor: Colors.transparent,
      leading: CustomBackButton(
        onPressed: () => print('Back Button Tapped'),
      ),
    );

    // ***** Checking for current Theme Mode *****
    var brightness = Theme.of(context).brightness;
    bool darkModeOn = brightness == Brightness.dark;

    return KeyboardDismisser(
      gestures: [
        GestureType.onTap,
        GestureType.onVerticalDragDown,
      ],
      child: Scaffold(
        resizeToAvoidBottomInset: false,
        appBar: isLoading ? null : appBar,
        body: SafeArea(
          child: Form(
            key: formKey,
            child: AutofillGroup(
              child: Center(
                child: SingleChildScrollView(
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 5.w),
                    child: Column(
                      children: [
                        SizedBox(height: 2.h),
                        if (!isKeyboard) BuildHeader(title: 'Welcome Onboard'),
                        if (!isKeyboard) SizedBox(height: 2.5.h),
                        BuildNameField(nameController: nameController, nameNode: nameNode, emailNode: emailNode),
                        SizedBox(height: 2.5.h),
                        BuildEmailField(emailController: emailController, emailNode: emailNode, passwordNode: passwordNode),
                        SizedBox(height: 2.5.h),
                        BuildPasswordField(passwordController: passwordController, passwordNode: passwordNode),
                        SizedBox(height: 2.5.h),
                        buildEmailSignUpButton(),
                        SizedBox(height: 2.h),
                        BuildAccountExistsButton(),
                        Spacer(),
                        BuildDividerRow(darkModeOn: darkModeOn),
                        Spacer(),
                        buildGoogleSignUpButton(darkModeOn),
                        SizedBox(height: 3.h),
                        buildAppleSignUpButton(darkModeOn),
                        Spacer(),
                        BuildFooter(),
                      ],
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }

I'm getting the following errors, I had to truncate a lot of errors as it was over the allowed limit:

======== Exception caught by rendering library =====================================================
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.

When a column is in a parent that does not provide a finite height constraint, for example if it is in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining space in the vertical direction.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.

Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible children (using Flexible rather than Expanded). This will allow the flexible children to size themselves to less than the infinite remaining space they would otherwise be forced to take, and then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum constraints provided by the parent.

If this message did not help you determine the problem, consider using debugDumpRenderTree():
  https://flutter.dev/debugging/#rendering-layer
  http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
The affected RenderFlex is: RenderFlex#6b876 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
  needs compositing
  parentData: offset=Offset(20.6, 0.0) (can use size)
  constraints: BoxConstraints(0.0<=w<=370.3, 0.0<=h<=Infinity)
  size: MISSING
  direction: vertical
  mainAxisAlignment: start
  mainAxisSize: max
  crossAxisAlignment: center
  verticalDirection: down
...  child 1: RenderConstrainedBox#b86cb NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=13.7)
...  child 2: RenderPositionedBox#4f180 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    alignment: Alignment.centerLeft
...    textDirection: ltr
...    widthFactor: expand
...    heightFactor: expand
...    child: RenderParagraph#eb54e NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0)
...      constraints: MISSING
...      size: MISSING
...      textAlign: start
...      textDirection: ltr
...      softWrap: wrapping at box width
...      overflow: clip
...      locale: en_US
...      maxLines: unlimited
...      text: TextSpan
...        debugLabel: (((englishLike display1 2014).merge(blackMountainView headline4)).copyWith).copyWith
...        inherit: false
...        color: Color(0x8a000000)
...        family: Roboto_700
...        familyFallback: Roboto
...        size: 27.4
...        weight: 700
...        baseline: alphabetic
...        decoration: TextDecoration.none
...        "Welcome Onboard"
...  child 3: RenderConstrainedBox#20957 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)
...  child 4: RenderConstrainedBox#dede6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(w=370.3, 0.0<=h<=Infinity)
...    child: RenderMouseRegion#22641 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      needs compositing
...      parentData: <none>
...      constraints: MISSING
...      size: MISSING
...      listeners: enter, exit
...      cursor: SystemMouseCursor(text)
...      child: RenderIgnorePointer#749a8 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        needs compositing
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        ignoring: false
...        ignoringSemantics: implicitly false
...        child: RenderSemanticsAnnotations#40667 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          needs compositing
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...  child 5: RenderConstrainedBox#67979 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)
...  child 6: RenderConstrainedBox#97d0d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(w=370.3, 0.0<=h<=Infinity)
...    child: RenderMouseRegion#7eeba NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      needs compositing
...      parentData: <none>
...      constraints: MISSING
...      size: MISSING
...      listeners: enter, exit
...      cursor: SystemMouseCursor(text)
...      child: RenderIgnorePointer#01dea NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        needs compositing
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        ignoring: false
...        ignoringSemantics: implicitly false
...        child: RenderSemanticsAnnotations#e03be NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          needs compositing
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...  child 7: RenderConstrainedBox#a5e4d NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)
...  child 8: RenderConstrainedBox#2f682 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(w=370.3, 0.0<=h<=Infinity)
...    child: RenderMouseRegion#bcb98 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      needs compositing
...      parentData: <none>
...      constraints: MISSING
...      size: MISSING
...      listeners: enter, exit
...      cursor: SystemMouseCursor(text)
...      child: RenderIgnorePointer#f66bd NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        needs compositing
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        ignoring: false
...        ignoringSemantics: implicitly false
...        child: RenderSemanticsAnnotations#7e929 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          needs compositing
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...  child 9: RenderConstrainedBox#1714f NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)
...    child 1: RenderConstrainedBox#3498e NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=0.0)
...      child: RenderPositionedBox#1b64a NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        alignment: Alignment.center
...        textDirection: ltr
...        widthFactor: expand
...        heightFactor: expand
...        child: RenderPadding#eb6fd NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          parentData: offset=Offset(0.0, 0.0)
...          constraints: MISSING
...          size: MISSING
...          padding: EdgeInsets.zero
...          textDirection: ltr
...    child 2: RenderConstrainedBox#eb389 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(w=20.6, 0.0<=h<=Infinity)
...    child 3: RenderParagraph#93a61 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      textAlign: start
...      textDirection: ltr
...      softWrap: wrapping at box width
...      overflow: clip
...      locale: en_US
...      maxLines: unlimited
...      text: TextSpan
...        debugLabel: ((englishLike body1 2014).merge(blackMountainView bodyText2)).merge(unknown)
...        inherit: false
...        color: Color(0xdd000000)
...        family: Roboto
...        size: 16.5
...        weight: 500
...        baseline: alphabetic
...        decoration: TextDecoration.none
...        "OR"
...    child 4: RenderConstrainedBox#50550 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(w=20.6, 0.0<=h<=Infinity)
...    child 5: RenderConstrainedBox#2a7e1 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=0.0)
...      child: RenderPositionedBox#0e343 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        alignment: Alignment.center
...        textDirection: ltr
...        widthFactor: expand
...        heightFactor: expand
...        child: RenderPadding#afb85 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          parentData: offset=Offset(0.0, 0.0)
...          constraints: MISSING
...          size: MISSING
...          padding: EdgeInsets.zero
...          textDirection: ltr
...  child 15: RenderConstrainedBox#451dd NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(w=0.0, h=0.0)
...    child 1: RenderParagraph#19d0c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      textAlign: center
...      textDirection: ltr
...      softWrap: wrapping at box width
...      overflow: clip
...      locale: en_US
...      maxLines: unlimited
...      text: TextSpan
...        debugLabel: ((englishLike body1 2014).merge(blackMountainView bodyText2)).merge(unknown)
...        inherit: false
...        color: Color(0xbf000000)
...        family: Roboto
...        size: 13.7
...        weight: 400
...        baseline: alphabetic
...        decoration: TextDecoration.none
...        "By using Netwersity you agree to it's"
...    child 2: RenderConstrainedBox#e36ee NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=3.4)
...    child 3: RenderFlex#ffd54 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      direction: horizontal
...      mainAxisAlignment: center
...      mainAxisSize: max
...      crossAxisAlignment: center
...      textDirection: ltr
...      verticalDirection: down
...      child 1: RenderSemanticsGestureHandler#bd90f NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...        constraints: MISSING
...        size: MISSING
...        behavior: deferToChild
...        gestures: tap
...        child: RenderPointerListener#43b96 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...          behavior: deferToChild
...          listeners: down
...      child 2: RenderConstrainedBox#a0757 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...        constraints: MISSING
...        size: MISSING
...        additionalConstraints: BoxConstraints(w=4.1, 0.0<=h<=Infinity)
...      child 3: RenderParagraph#55e37 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...        constraints: MISSING
...        size: MISSING
...        textAlign: center
...        textDirection: ltr
...        softWrap: wrapping at box width
...        overflow: clip
...        locale: en_US
...        maxLines: unlimited
...        text: TextSpan
...          debugLabel: ((englishLike body1 2014).merge(blackMountainView bodyText2)).merge(unknown)
...          inherit: false
...          color: Color(0xbf000000)
...          family: Roboto
...          size: 13.7
...          weight: 400
...          baseline: alphabetic
...          decoration: TextDecoration.none
...          "and"
...      child 4: RenderConstrainedBox#fac5c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...        constraints: MISSING
...        size: MISSING
...        additionalConstraints: BoxConstraints(w=4.1, 0.0<=h<=Infinity)
...      child 5: RenderSemanticsGestureHandler#52395 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...        constraints: MISSING
...        size: MISSING
...        behavior: deferToChild
...        gestures: tap
...        child: RenderPointerListener#92253 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...          behavior: deferToChild
...          listeners: down
...    child 4: RenderConstrainedBox#b1d09 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...      constraints: MISSING
...      size: MISSING
...      additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=13.7)
The creator information is set to: Column ← Padding ← _SingleChildViewport ← IgnorePointer-[GlobalKey#13af8] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#94304] ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#6bebf] ← RepaintBoundary ← ⋯
The nearest ancestor providing an unbounded width constraint is: _RenderSingleChildViewport#cf013 relayoutBoundary=up12 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...  needs compositing
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=603.4)
...  size: MISSING

See also: https://flutter.dev/layout/

If none of the above helps enough to fix this problem, please don't hesitate to file a bug:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md
The relevant error-causing widget was: 
  Column file:///Users/sas/Projects/Development/App/Flutter/my_app/lib/screens/sign_up.dart:81:28
When the exception was thrown, this was the stack: 
#0      RenderFlex.performLayout.<anonymous closure> (package:flutter/src/rendering/flex.dart:926:9)
#1      RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:929:6)
#2      RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
#3      RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:233:12)
#4      RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
...
The following RenderObject was being processed when the exception was fired: RenderFlex#6b876 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...  needs compositing
...  parentData: offset=Offset(20.6, 0.0) (can use size)
...  constraints: BoxConstraints(0.0<=w<=370.3, 0.0<=h<=Infinity)
...  size: MISSING
...  direction: vertical
...  mainAxisAlignment: start
...  mainAxisSize: max
...  crossAxisAlignment: center
...  verticalDirection: down
RenderObject: RenderFlex#6b876 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
  needs compositing
  parentData: offset=Offset(20.6, 0.0) (can use size)
  constraints: BoxConstraints(0.0<=w<=370.3, 0.0<=h<=Infinity)
  size: MISSING
  direction: vertical
  mainAxisAlignment: start
  mainAxisSize: max
  crossAxisAlignment: center
  verticalDirection: down
...  child 1: RenderConstrainedBox#b86cb NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=13.7)
...  child 2: RenderPositionedBox#4f180 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    alignment: Alignment.centerLeft
...    textDirection: ltr
...    widthFactor: expand
...    heightFactor: expand
...    child: RenderParagraph#eb54e NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      parentData: offset=Offset(0.0, 0.0)
...      constraints: MISSING
...      size: MISSING
...      textAlign: start
...      textDirection: ltr
...      softWrap: wrapping at box width
...      overflow: clip
...      locale: en_US
...      maxLines: unlimited
...      text: TextSpan
...        debugLabel: (((englishLike display1 2014).merge(blackMountainView headline4)).copyWith).copyWith
...        inherit: false
...        color: Color(0x8a000000)
...        family: Roboto_700
...        familyFallback: Roboto
...        size: 27.4
...        weight: 700
...        baseline: alphabetic
...        decoration: TextDecoration.none
...        "Welcome Onboard"
...  child 3: RenderConstrainedBox#20957 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)
...  child 4: RenderConstrainedBox#dede6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(w=370.3, 0.0<=h<=Infinity)
...    child: RenderMouseRegion#22641 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...      needs compositing
...      parentData: <none>
...      constraints: MISSING
...      size: MISSING
...      listeners: enter, exit
...      cursor: SystemMouseCursor(text)
...      child: RenderIgnorePointer#749a8 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...        needs compositing
...        parentData: <none>
...        constraints: MISSING
...        size: MISSING
...        ignoring: false
...        ignoringSemantics: implicitly false
...        child: RenderSemanticsAnnotations#40667 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...          needs compositing
...          parentData: <none>
...          constraints: MISSING
...          size: MISSING
...  child 5: RenderConstrainedBox#67979 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
...    constraints: MISSING
...    size: MISSING
...    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=17.1)

======== Exception caught by rendering library =====================================================
RenderBox was not laid out: RenderPadding#79c8b relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1930 pos 12: 'hasSize'
The relevant error-causing widget was: 
  SingleChildScrollView file:///Users/sas/Projects/Development/App/Flutter/my_app/lib/screens/sign_up.dart:78:24
====================================================================================================
.
.
.
======== Exception caught by rendering library =====================================================
RenderBox was not laid out: _RenderSingleChildViewport#cf013 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1930 pos 12: 'hasSize'
The relevant error-causing widget was: 
  SingleChildScrollView file:///Users/sas/Projects/Development/App/Flutter/my_app/lib/screens/sign_up.dart:78:24
====================================================================================================
xpetta
  • 607
  • 12
  • 28

4 Answers4

2

Finally, found a solution for this issue from this question How to use Expanded in SingleChildScrollView?

This was solution which worked for me:

LayoutBuilder(
  builder: (context, constraint) {
    return SingleChildScrollView(
      child: ConstrainedBox(
        constraints: BoxConstraints(minHeight: constraint.maxHeight),
        child: IntrinsicHeight(
          child: Column(
            children: <Widget>[
              Text("Header"),
              Expanded(
                child: Container(
                  color: Colors.red,
                ),
              ),
              Text("Footer"),
            ],
          ),
        ),
      ),
    );
  },
)
xpetta
  • 607
  • 12
  • 28
  • While testing found out an issue by making use of the above solution that error messages post validating the TextFormFields are not getting displayed. Not sure how to fix this. – xpetta Jun 24 '21 at 18:29
1

The issue with the code is, Column tries to shrink-wrap and fits inside the SingleChildScrollView. But, your Column widgets might not have a finite size that gives out the exception. Maybe putting up the Column inside an Expanded widget can consider the overflow (infinite length) and makes the column scrollable.

child: SingleChildScrollView(
  child: Padding(
    padding: EdgeInsets.symmetric(horizontal: 5.w),
    child: Expanded(  // This widget is added here
      child: Column(...),
    ),
  ),
),

Trying the above code will most probably solve your problem.

Edit:

The above solution might not solve the problem.

The below link is a reference for similar issue and OP was able to solve the issue and added an answer for the same.

How to use Expanded in SingleChildScrollView? an answer similar to the same case. Might be useful if you check there too.

immadisairaj
  • 608
  • 4
  • 11
  • 1
    If you ran this code before posting, you would see an error saying `incorrect use of parent widget` Padding can only be used inside row/column/flex widgets. And it will also not solve OPs error. – Huthaifa Muayyad Jun 24 '21 at 10:54
  • Thank you @immadisairaj for your help. But it's didn't work out. This has become like a nightmare to me. – xpetta Jun 24 '21 at 11:00
  • Thanks for pointing out Huthaifa. I would prefer @xpetta to once look at the link I have attached where in the accepted answer, they used MainAxisSize.min and FlexFit.loose using flexible instead of expanded in any of the child of column might probably solve the issue. – immadisairaj Jun 24 '21 at 12:27
  • 1
    Thanks for pointing me out to the link @immadisairaj it really helped me out in solving this issue. – xpetta Jun 24 '21 at 17:50
0

In a class that has a " Column " You need to change it to " ListView " to make it scrollable ..

You don't need to use " SingleChildScrollView " or other codes

Ahmad Raza
  • 758
  • 7
  • 26
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 12:32
-1

i also found the same issue.

Solutions:-

replace

SingleChildScrollView(
  physics: BouncingScrollPhysics()
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 5.w),
                    child: ListView(
                      physics: NeverScrollableScrollPhysics(),

with

SingleChildScrollView(
              child: Padding(
                padding: EdgeInsets.symmetric(horizontal: 5.w),
                child: Column(

it will definately work.