简体   繁体   中英

Flutter container inside a container using a widget

I want to add two boxes, one inside another. Here's my code and its not working for two boxes. how should I correct this. doc UI in this doc you can see the UI I implement so far and the UI I want to be implement.

Widget DetailBox() => Padding(
  padding: const EdgeInsets.only(left: 25, right: 25),
  child:Column(
    children: [
      Container(
          decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(30.0),
          color: Colors.white,
      ),
      // alignment: Alignment.bottomCenter,
      height: 400,
      width: 300,


        child:   Container(
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(30.0),
            color: Colors.lightBlue,
          ),
          // alignment: Alignment.bottomCenter,
          height: 100,
          width: 300,
      ),
      ),
    ],
  ),
);

May it help you

 Card(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(25),
          ),
          elevation: 5,
          shadowColor: Colors.blue.shade200,
          child: Column(
            children: [
              Expanded(
                flex: 1,

                child: Container(
                  decoration: BoxDecoration(
                      color: Colors.lightBlueAccent,
                    borderRadius: BorderRadius.only(topLeft:Radius.circular(25),topRight:Radius.circular(25))
                  ),


                ),
              ),
              Expanded(
                flex: 3,
                child: Container(

                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.only(bottomRight:Radius.circular(25),bottomLeft:Radius.circular(25))
                  ),


                ),
              )
            ],
          ),

        ),

在此处输入图像描述

According to the design of the app, put the image in the bule box.

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