0

i wanna add spacing between my widgets inside the column without hard coding every SizedBox and give them certain heights, i want to set it directly on the column but none of the alignment options work, what am i doing wrong? whats causing this?

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Submit Your Order'),
      ),
      body: SingleChildScrollView(
        child: Padding(
          padding: EdgeInsets.all(20.0),
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceAround, // doesnt work
              children: [
                InformationField(
                  label: 'Phone Number',
                  hintText: 'Type Your Phone Number',
                ),
                InformationField(
                  label: 'Name',
                  hintText: 'Type Your Name',
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    InformationField(
                      label: 'Adress',
                      hintText: 'Neighborhood/City',
                    ),
                    SizedBox(
                      height: 5.0,
                    ),
                    RowInformationField()
                  ],
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
azheen
  • 897
  • 4
  • 15
  • 30

1 Answers1

0

If you're using SingleChildScrollView don't expect mainAxisAlignment to work. I'd suggest you to replace it with CustomScrollView to achieve your desired results.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440