0

i am trying to increase the width of the two text buttons to fill up the space of the sizedbox at the very top. I like their position centered as they are i just want to increase their width.

        Positioned(
          top: 350,
          left: 35,
          child: SizedBox(
            width: width / 1.2,
            height: height / 3,

sizedbox that i want to increase the buttons width to.

            child: ClipRRect(
              borderRadius: BorderRadius.circular(20.0),
              child: Container(
                color: Colors.grey[850],
                child: Column(
                  children: [
                    SizedBox(
                      height: 90,
                    ),
                    SizedBox(
                      height: 10,
                    ),

textbutton 1 to increase width, placed above the other textbutton

                    TextButton(
                      style: ButtonStyle(
                          shape: MaterialStateProperty.all<
                              RoundedRectangleBorder>(
                            RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(18.0),
                            ),
                          ),
                          backgroundColor: MaterialStateProperty.all<Color>(
                              kcPrimaryColor),
                          foregroundColor: MaterialStateProperty.all<Color>(
                              Colors.white)),
                      onPressed: () {},
                      child: Text("Upload Picture"),
                    ),

textbutton 2 i would like to increase width of

                    TextButton(
                      onPressed: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                              builder: (context) => MusicPreferences()),
                        );
                      },
                      child: Text("I will do it later"),
                      style: ButtonStyle(
                          shape: MaterialStateProperty.all<
                              RoundedRectangleBorder>(
                            RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(18.0),
                            ),
                          ),
                          backgroundColor: MaterialStateProperty.all<Color>(
                              Colors.transparent),
                          foregroundColor: MaterialStateProperty.all<Color>(
                              kcPrimaryColor)),
                    ),
                  ],
                ),
              ),
            ),
          ),
        ),

This is just an extra sized box for design purposes with a picture, no need to change.

        Positioned(
          top: 290,
          left: 140,
          child: SizedBox(
              width: 150,
              height: 150,
              child: ClipRRect(
                borderRadius: BorderRadius.circular(100.0),
                child: Container(
                  color: Colors.grey[850],
                ),
              )),
        ),
        Positioned(
          top: 280,
          left: 165,
          child: SizedBox(
            width: 100,
            height: 150,
            child: CircleAvatar(
              backgroundImage:
                  AssetImage("lib/assets/images/randomface.jpg"),
            ),
          ),
        ),

1 Answers1

0

I wrapped both buttons with expanded and then wrapped that with a row to increase the width. That solved the issue