简体   繁体   中英

container border round inside row in flutter

I made some container, there is 2 container in one row. i try to make rounded border in each container using boxdecoration but seems like it cant place on here so i removed it. so anyone can help me to solve this.

  • and another question, how to make width margin in a column?i want to add a bit space on left inside column, look into 'image what i want'.

image from this code || image what i want

Container(
                margin: EdgeInsets.only(top: 22),
                height: 100,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: <Widget>[
                    Container(
                      width: 140,
                      child: Material(
                        color: kMainColor, // button color
                        child: InkWell(
                          splashColor: Colors.lightBlue[100], // splash color
                          onTap: () {}, // button pressed

                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              SvgPicture.asset(
                                'assets/icons/leaf.svg',
                                height: 30,
                                width: 30,
                                color: Colors.white,
                              ),
                              SizedBox(height: 10),
                              // icon
                              Text("Penanaman",
                                  style: GoogleFonts.roboto(
                                    fontSize: 17,
                                    color: Colors.white,
                                  )), // text
                            ],
                          ),
                        ),
                      ),
                    ),
                    Container(
                      width: 140,
                      child: Material(
                        color: kMainColor, // button color
                        child: InkWell(
                          splashColor: Colors.lightBlue[100], // splash color
                          onTap: () {}, // button pressed

                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              SvgPicture.asset(
                                'assets/icons/bug.svg',
                                height: 30,
                                width: 30,
                                color: Colors.white,
                              ),
                              SizedBox(height: 10),
                              Text("Penyakit & Hama",
                                  style: GoogleFonts.roboto(
                                    fontSize: 17,
                                    color: Colors.white,
                                  )), // text
                            ],
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              )

Have you looked into Card? Try wrapping each container with Card:

  Card(
       shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10.0)),
       child: Container(...)
  )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM