Home > Software engineering >  Flutter move row within column to the bottom of the page
Flutter move row within column to the bottom of the page

Time:08-11

I am trying to create a footer at the bottom of the page using SizedBox however I am having issues positioning it correctly.

I am using the following layout:

body: SingleChildScrollView(
  child:Column(
    children: [
      Center(),
      Center(),
      Spacer(),
      SizedBox()
    ]
  )
)

When I try to run it I get a renderflex error, after doing some searching around I saw people mention that i should wrap my column in Expanded or SizedBox however both of those do not work as they also give renderflex error's on their own. I also tried using align combined with mainAxisAlignment but that doesn't move anything.

Thanks in advance!

CodePudding user response:

if you're using scaffold, there is an option called bottomSheet , it exactly what you're looking for. exemple like this:

  return Scaffold(
    appBar: AppBar(),
    backgroundColor: Colors.white,
    bottomSheet: Container(),
    body: Container(),
  );

CodePudding user response:

maybe something like this?

body:Stack(
 children: [
 SingleChildScrollView(
  child:Column(
    children: [
        Center(),
        Center(),
        Spacer(),
       ]
     ),
   )`
   Positioned (
        bottom:0, 
        child:SizedBox(),
   )
 ]
),
  • Related